יחידה:תבנית מידע: הבדלים בין גרסאות בדף
מאין תקציר עריכה |
מאין תקציר עריכה |
||
| שורה 136: | שורה 136: | ||
]] | ]] | ||
function removeEmptyHeaders() | function removeEmptyHeaders() | ||
local lastHeaderIndex=nil | local lastHeaderIndex=nil | ||
local tempTemplateStructure = {} | local tempTemplateStructure = {} | ||
for i | for i,v in pairs(templateStructure) do | ||
if v~=nil then | |||
table.insert(tempTemplateStructure, templateStructure[ | 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 | ||