Navigation menu

Module:Infobox: Difference between revisions

From The Kodiak Republic Wiki

(1) return templatestyles when child=yes, (2) move templatestyles and categories before </tr> to avoid creating empty cells (see thread on talk page)
(nix)
((1) return templatestyles when child=yes, (2) move templatestyles and categories before </tr> to avoid creating empty cells (see thread on talk page))
Line 13:
local marker = '<span class=special_infobox_marker>'
local s = sval
-- start moving templatestyles and categories inside of table rows
local slast = ''
while slast ~= s do
slast = s
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*%]%])', '%2%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(<templatestyles[^<>]*>%s*</templatestyles>)', '%2%1')
end
-- end moving templatestyles and categories inside of table rows
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
Line 123 ⟶ 131:
end
elseif rowArgs.data and rowArgs.data:gsub(
category_in_empty_row_pattern, ''
):match('^%S') then
has_rows = true
Line 456 ⟶ 464:
renderTitle()
renderAboveRow()
structure_infobox_common()
 
return loadTemplateStyles() .. root
else
root = mw.html.create()
Line 464 ⟶ 469:
root
:wikitext(args.title)
 
structure_infobox_common()
return root
end
structure_infobox_common()
return loadTemplateStyles() .. root
end
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.