Module:StripWikitext

local p = {}

p.main1 = function (str) local stripped = mw.ustring.gsub( str == nil and '' or tostring(str), "", " " ) stripped = mw.ustring.gsub( stripped, "%%]", "" ) stripped = mw.ustring.gsub( stripped, "%[%[([^|]-)%]%]", "%1" ) stripped = mw.ustring.gsub( stripped, "%[%[([^|]-)|([^%]]-)%]%]", "%2" ) stripped = mw.ustring.gsub( stripped, ">", "&gt;" ) stripped = mw.ustring.gsub( stripped, "<", "&lt;" ) stripped = mw.ustring.gsub( stripped, "\"", "&#34;" )	stripped = mw.ustring.gsub( stripped, "(.-)", "%1" )	stripped = mw.ustring.gsub( stripped, "(.-)", "%1" )	return stripped end

p._main = function (args) return p.main1(args[1]) end

p.main = function (frame) return p.main1(frame.args[1]) end

return p