Module:StripTags
Documentation for this module may be created at Module:StripTags/doc
local p = {}
local function decodeHtmlEntities(text)
local entities = {
["""] = '"',
["&"] = "&",
["<"] = "<",
[">"] = ">",
["'"] = "'",
["'"] = "'"
}
return text:gsub("(&#?[%w]+;)", entities)
end
function p.stripTags(frame)
local text = frame.args[1]
-- Remove HTML tags
text = mw.ustring.gsub(text, '<[^>]->', '')
-- Decode HTML entities
text = decodeHtmlEntities(text)
return text
end
return p