Module:If preview: Difference between revisions
Appearance
parvej>Wikitia Created page with "-- Module:If preview -- Returns a warning only when previewing the page local p = {} function p._warning(args) local preview = args[1] or '' local frame = mw.getCurrentFrame() -- Check if we're in a preview if frame:preprocess('{{REVISIONID}}') == '' then return preview end return '' end function p.warning(frame) local args = require('Module:Arguments').getArgs(frame) return p._warning(args) end return p" Â |
m 1 revision imported  |
(No difference)
| |
Latest revision as of 11:43, 25 May 2026
Documentation for this module may be created at Module:If preview/doc
-- Module:If preview
-- Returns a warning only when previewing the page
local p = {}
function p._warning(args)
local preview = args[1] or ''
local frame = mw.getCurrentFrame()
-- Check if we're in a preview
if frame:preprocess('{{REVISIONID}}') == '' then
return preview
end
return ''
end
function p.warning(frame)
local args = require('Module:Arguments').getArgs(frame)
return p._warning(args)
end
return p