Editing Module:Hatnote
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 109: | Line 109: | ||
category | category | ||
) | ) | ||
end | end | ||
Line 162: | Line 153: | ||
local page, section = link:match('^(.-)#(.*)$') | local page, section = link:match('^(.-)#(.*)$') | ||
if page then | if page then | ||
display = page .. ' § | display = page .. ' § ' .. section | ||
end | end | ||
end | end | ||
Line 168: | Line 159: | ||
-- Assemble the link. | -- Assemble the link. | ||
if display then | if display then | ||
return string.format( | return string.format('[[:%s|%s]]', link, display) | ||
else | else | ||
return string.format('[[:%s]]', link) | return string.format('[[:%s]]', link) | ||
Line 204: | Line 191: | ||
checkType('_hatnote', 2, options, 'table', true) | checkType('_hatnote', 2, options, 'table', true) | ||
options = options or {} | options = options or {} | ||
local classes = {'hatnote | local classes = {'hatnote'} | ||
local extraclasses = options.extraclasses | local extraclasses = options.extraclasses | ||
local selfref = options.selfref | local selfref = options.selfref | ||
Line 214: | Line 201: | ||
end | end | ||
return string.format( | return string.format( | ||
'<div | '<div class="%s">%s</div>', | ||
table.concat(classes, ' '), | table.concat(classes, ' '), | ||
s | s |