Jump to content

Module:Expand wikitext: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Created page with 'local p = {} function p.main(frame) return frame:preprocess(frame.args[1]) end return p'
 
Allow entire code to be wrapper in a nowiki tag, for case when constructing the desired code requires too much escaping
Line 2: Line 2:


function p.main(frame)
function p.main(frame)
return frame:preprocess(frame.args[1])
local code = frame.args[1]
if mw.text.trim(mw.text.killMarkers(code)) == "" then
code = mw.text.unstripNowiki(code);
end
return frame:preprocess(code)
end
end



Revision as of 18:51, 21 June 2017

local p = {}

function p.main(frame)
	local code = frame.args[1]
	if mw.text.trim(mw.text.killMarkers(code)) == "" then
		code = mw.text.unstripNowiki(code);
	end
	return frame:preprocess(code)
end

return p