Anonymous user
Module:Unsubst: Difference between revisions
m
all uses removed
No edit summary |
m (all uses removed) |
||
Line 1:
local p = {}
local specialParams = {
['$B'] = 'template content',
}
p[''] = function ( frame )
if not frame:getParent() then
Line 13 ⟶ 12:
error( '{{#invoke:Unsubst|}} requires parameter $B (template content)' )
end
if mw.isSubsting() then
---- substing
Line 29 ⟶ 28:
args[k] = v
end
-- Build an equivalent template invocation
-- First, find the title to use
Line 41 ⟶ 40:
title = titleobj.prefixedText
end
-- Build the invocation body with numbered args first, then named
local ret = '{{' .. title
Line 55 ⟶ 54:
ret = ret .. '|' .. k .. '=' .. v
end
return ret .. '}}'
else
---- Not substing
-- Just return the "body"
return frame.args['$B']
end
end
return p
|