Content deleted Content added
No edit summary |
No edit summary |
||
Line 39:
return table.concat(searchStrings, separator)
end
local searchTerms = {}▼
for i, s in ipairs(args) do▼
searchTerms[i] = s▼
end▼
if not searchTerms[1] then▼
-- Use the current subpage name as the default search term. If the page▼
-- uses a disambiguator like "Foo (bar)", make "Foo" the first term and▼
-- "bar" the second.▼
local term, dab = title.subpageText:match('^(.*) (%b())$')▼
if dab then▼
dab = dab:sub(2, -2) -- Remove parens▼
end▼
if term and dab then▼
searchTerms[1] = term▼
searchTerms[2] = dab▼
else▼
end▼
end▼
searchTerms[1] = '"' .. searchTerms[1] .. '"'▼
function p._renderLink(code, searchTerms, display)
-- Renders the external link wikicode for one link, given the link code,
Line 90 ⟶ 67:
return string.format('[%s %s]', url, display or linkCfg.display)
end
Line 136 ⟶ 101:
-- Get the search terms from the arguments.
local searchTerms =
▲ for i, s in ipairs(args) do
▲ end
▲ if not searchTerms[1] then
▲ -- Use the current subpage name as the default search term. If the page
▲ -- uses a disambiguator like "Foo (bar)", make "Foo" the first term and
▲ -- "bar" the second.
▲ local term, dab = title.subpageText:match('^(.*) (%b())$')
▲ if dab then
▲ dab = dab:sub(2, -2) -- Remove parens
▲ end
▲ if term and dab then
▲ searchTerms[1] = term
▲ else
▲ end
▲ end
▲ searchTerms[1] = '"' .. searchTerms[1] .. '"'
-- Make the intro link
|