Module:Preview warning

local p = {}

--[[ main

This function returns parameter 1 as a warning if the page containing it is being previewed.

Usage:

]]

function p.main(frame) local preview = frame.args[1]:match('^%s*(.-)%s*$') or '' if preview == '' then preview = 'Something is wrong with this template' end if frame:preprocess( "" ) == "" then return ' Warning: ' .. preview .. ' (this message is shown only in preview) ' end end

return p