Importer, Bürokraten, Moderatoren (CommentStreams), Strukturierte-Diskussionen-Bots, Oberflächenadministratoren, Push-Abonnementverwalter, Oversighter, Administratoren, Kampagnenbearbeiter (Hochladeassistent)
855
Bearbeitungen
(add role="note" for screen readers per protected edit request by User:Matt Fitzpatrick) |
K (59 Versionen von wpen:Module:Hatnote importiert) |
||
| (21 dazwischenliegende Versionen von 8 Benutzern werden nicht angezeigt) | |||
| 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 | ||
| Zeile 153: | Zeile 162: | ||
local page, section = link:match('^(.-)#(.*)$') | local page, section = link:match('^(.-)#(.*)$') | ||
if page then | if page then | ||
display = page .. ' § ' .. section | display = page .. ' § ' .. section | ||
end | end | ||
end | end | ||
| Zeile 159: | Zeile 168: | ||
-- Assemble the link. | -- Assemble the link. | ||
if display then | if display then | ||
return string.format('[[:%s|%s]]', link, display) | return string.format( | ||
'[[:%s|%s]]', | |||
string.gsub(link, '|(.*)$', ''), --display overwrites manual piping | |||
display | |||
) | |||
else | else | ||
return string.format('[[:%s]]', link) | return string.format('[[:%s]]', link) | ||
| Zeile 191: | Zeile 204: | ||
checkType('_hatnote', 2, options, 'table', true) | checkType('_hatnote', 2, options, 'table', true) | ||
options = options or {} | options = options or {} | ||
local classes = {'hatnote'} | local classes = {'hatnote', 'navigation-not-searchable'} | ||
local extraclasses = options.extraclasses | local extraclasses = options.extraclasses | ||
local selfref = options.selfref | local selfref = options.selfref | ||