Jump to content

Module:Call wikitext

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Lemondoge (talk | contribs) at 22:31, 30 March 2023 (Lemondoge moved page Module:Sandbox/Lemondoge/SpoofTemplate to Module:ArgRest/testCaser without leaving a redirect: Module is intended exclusively to allow argRest to be tested in a /testcases page). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

p = {}

function p.main(frame)
	local code = frame.args['sourceCode'] or error("sourceCode arg not provided")
	if code:match'nowiki' then -- undo nowiki sanitization
		code = mw.text.unstripNoWiki(code)
	else error("sourceCode arg was missing <nowiki>") end
    return frame:preprocess(code:gsub("&lt;", "<"):gsub("&gt;", ">"))
end

return p