Module:Hatnote: Difference between revisions

Adding ability to handle "inline" parameter; sandboxed this at Module:Hatnote/sandbox-inline and with Template:Hatnote-inline. I have big plans for this.
m (Protected Module:Hatnote: High-risk Lua module ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite)))
(Adding ability to handle "inline" parameter; sandboxed this at Module:Hatnote/sandbox-inline and with Template:Hatnote-inline. I have big plans for this.)
Line 184:
options.extraclasses = args.extraclasses
options.selfref = args.selfref
options.inline = args.inline
return p._hatnote(s, options)
end
Line 193 ⟶ 194:
local extraclasses = options.extraclasses
local selfref = options.selfref
local inline = options.inline
if type(extraclasses) == 'string' then
classes[#classes + 1] = extraclasses
Line 199 ⟶ 201:
classes[#classes + 1] = 'selfref'
end
if inline then
return string.format(
'<div class="%s">%s</div>',
'<span class="%s">%s</span>',
table.concat(classes, ' '),
s
)
)
else
return string.format(
'<div class="%s">%s</div>',
table.concat(classes, ' '),
s
)
end
end
 
Anonymous user