Content deleted Content added
BrandonXLF (talk | contribs) No edit summary |
BrandonXLF (talk | contribs) No edit summary |
||
Line 6:
local items = {}
-- Parse each row
for indent, item in wikitext:gmatch("(**) *([^\n]+)") do
items[#items + 1] = {'*' .. indent, item}
end
-- Bold sublist titles and add a blank list item before them
-- The blank item is used by CSS to make the list item block leel
for i, item in pairs(items) do
if i < #items and #items[i + 1][1] > #item[1] then
-- Add {{Inline sublist}} after the bold and italics
item[2] = "'''''" .. item[2] .. "'''''"▼
local inlineNext = item[2]:match('INLINE%-UL$') ~= ni
if inlineNext then
item[2] = item[2]:gsub(' *INLINE%-UL$', '')
end
local post = inlineNext and ':' or ''
▲ item[2] = '\n' .. item[1] .. "'''''" .. item[2] .. post .. "'''''"
if inlineNext then
item[2] = item[2] .. '<span class="content-inline-ul"></span>'
end
end
end
Line 20 ⟶ 35:
for _, item in pairs(items) do
out = out .. item[1] .. item[2] .. '\n'
return '<div class="content-list">\n' .. out .. '</div>' .. frame:extensionTag{
name = 'templatestyles', args = { src = 'User:BrandonXLF/styles2.css' }
▲ }
end
|