Zum Inhalt springen

Modul:Hatnote: Unterschied zwischen den Versionen

Adding ability to handle "inline" parameter; sandboxed this at Module:Hatnote/sandbox-inline and with Template:Hatnote-inline. I have big plans for this.
K (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.)
Zeile 184: Zeile 184:
options.extraclasses = args.extraclasses
options.extraclasses = args.extraclasses
options.selfref = args.selfref
options.selfref = args.selfref
options.inline = args.inline
return p._hatnote(s, options)
return p._hatnote(s, options)
end
end
Zeile 193: Zeile 194:
local extraclasses = options.extraclasses
local extraclasses = options.extraclasses
local selfref = options.selfref
local selfref = options.selfref
local inline = options.inline
if type(extraclasses) == 'string' then
if type(extraclasses) == 'string' then
classes[#classes + 1] = extraclasses
classes[#classes + 1] = extraclasses
Zeile 199: Zeile 201:
classes[#classes + 1] = 'selfref'
classes[#classes + 1] = 'selfref'
end
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
end


return p
return p
Anonymer Benutzer