Module:If preview: Difference between revisions

Prune function duplication
m (Changed protection level for "Module:If preview": Highly visible page: 1000+ uses ([Edit=Require extended confirmed access] (indefinite)))
(Prune function duplication)
Line 33:
 
function p.pmain(frame)
local parent =return p.main(frame.:getParent(frame))
local result = ''
Preview_mode = frame:preprocess('{{REVISIONID}}'); -- use magic word to get revision id
if not (Preview_mode == nil or Preview_mode == '') then -- if there is a value then this is not a preiview
result = parent.args[2]
else
result = parent.args[1]; -- no value (nil or empty string) so this is a preview
end
return result
end
 
Anonymous user