Content deleted Content added
add pmain back |
does this work? |
||
Line 1:
local p = {}
local is_preview = mw.loadData('Module:Preview warning/is preview')
--[[
is_preview
Line 20 ⟶ 21:
This function returns either the first argument or second argument passed to
this module, depending on whether the page is being previewed.
]]
function p.main(frame)
if is_preview
return frame.args[1] or ''
else
Line 39 ⟶ 37:
this module's parent (i.e. template using this module), depending on whether it
is being previewed.
]]
Line 53 ⟶ 48:
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)
if not is_preview
local warning = frame.args[1]:match('^%s*(.-)%s*$') or ''
|