Modul:Namespace detect: Unterschied zwischen den Versionen
trim whitespace, just in case, tweak frame code comment
(ok, this should actually work) |
(trim whitespace, just in case, tweak frame code comment) |
||
| Zeile 148: | Zeile 148: | ||
-- Process the arguments. | -- Process the arguments. | ||
function p.main(frame) | function p.main(frame) | ||
-- If called via #invoke, use the args passed into the invoking template. | -- If called via #invoke, use the args passed into the invoking | ||
-- | -- template, or the args passed to #invoke if any exist. Otherwise | ||
-- assume args are being passed directly in. | |||
local origArgs | local origArgs | ||
if frame == mw.getCurrentFrame() then | if frame == mw.getCurrentFrame() then | ||
| Zeile 161: | Zeile 162: | ||
end | end | ||
-- | -- Trim whitespace and remove blank arguments for demospace and | ||
-- page parameters. | |||
for k, v in pairs(origArgs) do | for k, v in pairs(origArgs) do | ||
v = mw.text.trim(v) -- Trim whitespace. | |||
if k == cfg.demospace or k == cfg.page then | if k == cfg.demospace or k == cfg.page then | ||
if v ~= '' then | if v ~= '' then | ||