Jump to content

Module:Call wikitext: Difference between revisions

From Wikipedia, the free encyclopedia
No edit summary
m 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
(No difference)

Revision as of 22:31, 30 March 2023

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