Module:Unsubst: திருத்தங்களுக்கு இடையிலான வேறுபாடு
உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
"local p = {} local specialParams = { ['$N'] = 'template name', ..."-இப்பெயரில் புதிய பக்கம் உருவாக்கப்பட்டுள்ளது |
Deprecate the $N parameter; the template name is now detected automatically. The $N check is still present until all transclusions have been updated. Code courtesy of Anomie, Jackmcbarn and myself. |
||
வரிசை 2:
local specialParams = {
['$N'] = 'template name', -- Deprecated, but keeping until it is removed from transcluding templates
['$B'] = 'template content',
}
வரிசை 8:
p[''] = function ( frame )
if not frame:getParent() then
error( '{{#invoke:Unsubst|
end
▲ if not frame.args[k] then
▲ error( '{{#invoke:Unsubst|unsubst}} requires parameter ' .. k .. ' (' .. v .. ')' )
end▼
end
வரி 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
| |||