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

מאין תקציר עריכה
מאין תקציר עריכה
שורה 136: שורה 136:
]]
]]
function removeEmptyHeaders()
function removeEmptyHeaders()
local j=0
  local lastHeaderIndex=nil
  local lastHeaderIndex=nil
  local tempTemplateStructure = {}
  local tempTemplateStructure = {}
  for i=1,#templateStructure do
  for i,v in pairs(templateStructure) do
if templateStructure[i]~=nil then
  if v~=nil then
  table.insert(tempTemplateStructure, templateStructure[i])
if v.header then
  lastHeaderIndex = i
else
if lastHeaderIndex then
table.insert(tempTemplateStructure, templateStructure[lastHeaderIndex])
lastHeaderIndex = nil
end
table.insert(tempTemplateStructure, v)
end
  end
  end
  end
  end
  templateStructure=tempTemplateStructure
  templateStructure=tempTemplateStructure
end
end