Module:Infobox: Difference between revisions

don't add empty div
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 4: Line 4:
local titleObject = mw.title.getCurrentTitle()
local titleObject = mw.title.getCurrentTitle()
local title = args.title or titleObject.baseText
local title = args.title or titleObject.baseText
local template = f:getParent():getTitle():lower():gsub( 'template:', '' )
local template = f:getParent():getTitle():lower():gsub( 'template:', '' ):gsub( 'infobox ', '' )
local headerArea = ''
local headerArea = ''
Line 10: Line 10:
images = {},
images = {},
invimages = {},
invimages = {},
rows = {}
rows = {},
}
}
Line 230: Line 230:
end
end
args.rows = string.gsub( args.rows or '', '<code class="history%-json">{"label": (".-"), "field": (".-")}</code>\n', repl )
args.rows = string.gsub( args.rows or '', '<code class="history%-json">{"label": (".-"), "field": (".-")}</code>\n', repl )
args.rows2 = string.gsub( args.rows2 or '', '<code class="history%-json">{"label": (".-"), "field": (".-")}</code>\n', repl )
 
local html = {
local html = {
'<div class="notaninfobox">',
'<div class="notaninfobox">',
Line 238: Line 239:
'|-',
'|-',
args.rows or '',
args.rows or '',
args.rows2 or '',
footer or '',
footer or '',
'|}',
'|}',