Module:Unsubst and Module:Unsubst/sandbox: Difference between pages
(Difference between pages)
Content deleted Content added
Yay, no more hack! |
fix title object usage - those should be properties, not methods |
||
Line 10:
error( '{{#invoke:Unsubst|unsubst}} makes no sense without a parent frame' )
end
▲ if not frame.args[k] then
▲ error( '{{#invoke:Unsubst|unsubst}} requires parameter ' .. k .. ' (' .. v .. ')' )
end▼
end
Line 32 ⟶ 30:
end
--
-- First,
local
local title
if titleobj.namespace == 10 then -- NS_TEMPLATE
title = titleobj.text
elseif titleobj.namespace == 0 then -- NS_MAIN
title = ':' .. titleobj.text
else
title = titleobj.prefixedText
▲ end
-- Build the invocation body with numbered args first, then named
local ret = '{{' .. title
for k, v in ipairs( args ) do
if string.find( v, '=', 1, true ) then
|