Content deleted Content added
m Accept selected= as a string with a numeric value, e.g. "3" |
Supporting named article keys in Transclude selected excerpt. Dispose of Efn-ua templates. |
||
Line 68:
local function striptemplate(t)
local unwanted = {"[Ee]fn", "[Ee]fn%-
"[CcDd]n", "[Cc]itation needed", "[Dd]isambiguation needed"}
for _, u in pairs(unwanted) do
Line 215:
-- Shared template invocation code for lead and random functions
local function invoke(frame,
-- args = { 1,2,... = page names, paragraphs = list e.g. "1,3-5", files = list, more = text}
local args = {} -- args[k] = frame.args[k] or frame:getParent().args[k] for all k in either (numeric or not)
Line 223:
local pagenames = {}
local articlecount = #args
if articlekey then -- 1 for lead template; "selected" for selected template
if articlecount < 1 then err("No articles provided") end▼
articlekey = tonumber(articlekey) or args[articlekey]
if tonumber(articlekey) then
-- normalise
if articlecount < 1 then err("No articles provided") end
if articlekey == 0 then articlekey = articlecount end
end
pagenames = { args[articlekey] }
else
-- For random, accept any number of page names. If more than one, we'll pick one randomly
for i, p in pairs(args) do
if p and type(i) == 'number' then table.insert(pagenames, p) end
|