Module:Infobox: Difference between revisions
remove extra newline from the below row, use a div tag instead of a span tag for image captions, per talk
m>Mr. Stradivarius (fix phantom reference bug) |
m>Mr. Stradivarius (remove extra newline from the below row, use a div tag instead of a span tag for image captions, per talk) |
||
Line 116: | Line 116: | ||
.newline() | .newline() | ||
.wikitext(args.below) | .wikitext(args.below) | ||
end | end | ||
Line 129: | Line 128: | ||
for k, num in ipairs(subheadernums) do | for k, num in ipairs(subheadernums) do | ||
addRow({ | addRow({ | ||
data = args['subheader' .. num], | data = args['subheader' .. tostring(num)], | ||
datastyle = args.subheaderstyle or args['subheaderstyle' .. num], | datastyle = args.subheaderstyle or args['subheaderstyle' .. tostring(num)], | ||
class = args.subheaderclass, | class = args.subheaderclass, | ||
rowclass = args['subheaderrowclass' .. num] | rowclass = args['subheaderrowclass' .. tostring(num)] | ||
}) | }) | ||
end | end | ||
Line 146: | Line 145: | ||
local imagenums = getArgNums('image') | local imagenums = getArgNums('image') | ||
for k, num in ipairs(imagenums) do | for k, num in ipairs(imagenums) do | ||
local caption = args['caption' .. num] | local caption = args['caption' .. tostring(num)] | ||
local data = HtmlBuilder.create().wikitext(args['image' .. num]) | local data = HtmlBuilder.create().wikitext(args['image' .. tostring(num)]) | ||
if caption then | if caption then | ||
data | data | ||
.tag('br', {selfClosing = true}) | .tag('br', {selfClosing = true}) | ||
.done() | .done() | ||
.tag(' | .tag('div') | ||
.cssText(args.captionstyle) | .cssText(args.captionstyle) | ||
.wikitext(caption) | .wikitext(caption) | ||
Line 160: | Line 159: | ||
datastyle = args.imagestyle, | datastyle = args.imagestyle, | ||
class = args.imageclass, | class = args.imageclass, | ||
rowclass = args['imagerowclass' .. num] | rowclass = args['imagerowclass' .. tostring(num)] | ||
}) | }) | ||
end | end | ||
Line 172: | Line 171: | ||
for k, num in ipairs(rownums) do | for k, num in ipairs(rownums) do | ||
addRow({ | addRow({ | ||
header = args['header' .. num], | header = args['header' .. tostring(num)], | ||
label = args['label' .. num], | label = args['label' .. tostring(num)], | ||
data = args['data' .. num], | data = args['data' .. tostring(num)], | ||
datastyle = args.datastyle, | datastyle = args.datastyle, | ||
class = args['class' .. num], | class = args['class' .. tostring(num)], | ||
rowclass = args['rowclass' .. num] | rowclass = args['rowclass' .. tostring(num)] | ||
}) | }) | ||
end | end |