Module:Hatnote: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(add role="note" for screen readers per protected edit request by User:Matt Fitzpatrick) |
(Added a simple p.disambiguate(page [, disambiguator]) helper function) |
||
Line 109: | Line 109: | ||
category |
category |
||
) |
) |
||
end |
|||
function p.disambiguate(page, disambiguator) |
|||
-- Formats a page title with a disambiguation parenthetical, |
|||
-- i.e. "Example" → "Example (disambiguation)". |
|||
checkType('disambiguate', 1, page, 'string') |
|||
checkType('disambiguate', 2, disambiguator, 'string', true) |
|||
disambiguator = disambiguator or 'disambiguation' |
|||
return string.format('%s (%s)', page, disambiguator) |
|||
end |
end |
||