Module:If preview/sandbox: Difference between revisions

Content deleted Content added
and remove that fail
drp
Line 39:
end
 
function p.warning_warning(frameargs)
--[[
warning
 
This function returns a "preview warning", which is the first argument marked
up with HTML and some supporting text, depending on whether the page is being previewed.
 
]]
function p.warning(frame)
local warning = frame.args[1] and frame.args[1]:match('^%s*(.-)%s*$') or ''
if warning == '' then
return warning_text(cfg.missing_warning)
Line 56 ⟶ 49:
return warning_text(warning)
end
 
--[[
warning
 
This function returns a "preview warning", which is the first argument marked
up with HTML and some supporting text, depending on whether the page is being previewed.
 
]]
function p.warning(frame)
return _warning(frame.args)
end
 
--[[
warning, but for pass-through templates like {{preview warning}}
]]
function p.pwarning(frame)
return _warning(frame:getParent().args)
end