Module:Excerpt slideshow/sandbox: Difference between revisions

Content deleted Content added
fix variable name
show bullet after un-indenting
Line 28:
local htmlList = {}
for i, this in ipairs( listParts ) do
local lastLevelisFirstItem = ( i == 1 ) and '' or listParts[i-1]['level']
local nextLevelisLastItem = ( i == #listParts ) and '' or listParts[i+1]['level']
local lastLevel = isFirstItem and '' or listParts[i-1]['level']
local tags
if #lastLevel == #this.level then
Line 35 ⟶ 36:
elseif #this.level > #lastLevel then
tags = string.rep('<ul><li>', #this.level - #lastLevel)
elseif isLastItem then
else -- #this.level < #lastLevel
tags = string.rep('</li></ul>', #lastLevel - #this.level )
else -- ( #this.level < #lastLevel ) and not last item
tags = string.rep('</li></ul>', #lastLevel - #this.level ) .. '</li><li>'
end
table.insert(htmlList, tags .. this.item)