Module:Hatnote: Difference between revisions

Undid revision 609825678 by SMcCandlish (talk) this change will have quite far-reaching consequences, so should be discussed first
(Adding ability to handle "inline" parameter; sandboxed this at Module:Hatnote/sandbox-inline and with Template:Hatnote-inline. I have big plans for this.)
(Undid revision 609825678 by SMcCandlish (talk) this change will have quite far-reaching consequences, so should be discussed first)
Line 184:
options.extraclasses = args.extraclasses
options.selfref = args.selfref
options.inline = args.inline
return p._hatnote(s, options)
end
Line 194 ⟶ 193:
local extraclasses = options.extraclasses
local selfref = options.selfref
local inline = options.inline
if type(extraclasses) == 'string' then
classes[#classes + 1] = extraclasses
Line 201 ⟶ 199:
classes[#classes + 1] = 'selfref'
end
return string.format(
if inline then
'<div class="%s">%s</div>',
return string.format(
table.concat(classes, ' '),
'<span class="%s">%s</span>',
s
table.concat(classes, ' '),
)
s
)
else
return string.format(
'<div class="%s">%s</div>',
table.concat(classes, ' '),
s
)
end
end
 
Anonymous user