Modul:Hatnote: Unterschied zwischen den Versionen
Added a simple p.disambiguate(page [, disambiguator]) helper function
(add role="note" for screen readers per protected edit request by User:Matt Fitzpatrick) |
(Added a simple p.disambiguate(page [, disambiguator]) helper function) |
||
Zeile 109: | Zeile 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 | ||