Module:Unsubst: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1:
local p = {}
 
local specialParams = {
['$N'] = 'template name', -- Deprecated, but keeping until it is removed from transcluding templates
['$B'] = 'template content',
}
 
p[''] = function ( frame )
if not frame:getParent() then
Line 13:
error( '{{#invoke:Unsubst|}} requires parameter $B (template content)' )
end
if mw.isSubsting() then
---- substing
Line 29:
args[k] = v
end
 
-- Build an equivalent template invocation
-- First, find the title to use
Line 41:
title = titleobj.prefixedText
end
 
-- Build the invocation body with numbered args first, then named
local ret = '{{' .. title
Line 55:
ret = ret .. '|' .. k .. '=' .. v
end
return ret .. '}}'
else
Line 63:
end
end
 
return p
Anonymous user