יחידה:תבנית מידע: הבדלים בין גרסאות בדף

מאין תקציר עריכה
מאין תקציר עריכה
שורה 138: שורה 138:
  local j=0
  local j=0
  local lastHeaderIndex=nil
  local lastHeaderIndex=nil
local tempTemplateStructure = {}
  for i=1,#templateStructure do
  for i=1,#templateStructure do
  if templateStructure[i]~=nil then
  if templateStructure[i]~=nil then
שורה 145: שורה 146:
  if lastHeaderIndex then
  if lastHeaderIndex then
  j=j+1
  j=j+1
  templateStructure[j]=templateStructure[lastHeaderIndex]
  table.insert(tempTemplateStructure, templateStructure[lastHeaderIndex])
  lastHeaderIndex = nil
  lastHeaderIndex = nil
  end
  end
  j=j+1
  table.insert(tempTemplateStructure, templateStructure[i])
templateStructure[j]=templateStructure[i]
  end
  end
  end
  end
  end
  end
   
   
  for i=#templateStructure,j,-1 do
  templateStructure=tempTemplateStructure
table.remove(templateStructure, i)
end
end
end