Modul:Hatnote list: Unterschied zwischen den Versionen
Removed options.disambiguator and moved its uses to new mHatnote.disambiguate()
(Updated from sandbox) |
(Removed options.disambiguator and moved its uses to new mHatnote.disambiguate()) |
||
| Zeile 76: | Zeile 76: | ||
--default options table used across the forSee family of functions | --default options table used across the forSee family of functions | ||
local forSeeDefaultOptions = { | local forSeeDefaultOptions = { | ||
title = mw.title.getCurrentTitle().text, | title = mw.title.getCurrentTitle().text, | ||
otherText = 'other uses', | otherText = 'other uses', | ||
| Zeile 123: | Zeile 122: | ||
forRow.pages = {} | forRow.pages = {} | ||
-- If there's not at least one page listed, use the default. | -- If there's not at least one page listed, use the default. | ||
table.insert(forRow.pages, args[i + 1] or (options.title | table.insert(forRow.pages, args[i + 1] or mHatnote.disambiguate(options.title)) | ||
-- If the option after next is "and", do an inner loop where we collect | -- If the option after next is "and", do an inner loop where we collect | ||
-- items following "and"'s until the "and"'s stop. If there's a blank | -- items following "and"'s until the "and"'s stop. If there's a blank | ||
| Zeile 157: | Zeile 156: | ||
local useStr = v.use or options.otherText | local useStr = v.use or options.otherText | ||
local pagesStr = p.andList(mHatnote.formatPages(unpack(v.pages))) or | local pagesStr = p.andList(mHatnote.formatPages(unpack(v.pages))) or | ||
mHatnote._formatLink(options.title | mHatnote._formatLink(mHatnote.disambiguate(options.title)) | ||
local forSeeStr = string.format(options.forseeForm, useStr, pagesStr) | local forSeeStr = string.format(options.forseeForm, useStr, pagesStr) | ||
for k, v in pairs(options.punctuationCollapseReplacements) do | for k, v in pairs(options.punctuationCollapseReplacements) do | ||