More actions
Documentation for this module may be created at Module:Deformat/doc
-- Module:Deformat
-- Removes dollar-sign based formatting codes from a string.
local p = {}
function p.run(frame)
local text = frame.args[1] or ''
if text == '' then return '' end
local s = text
s = mw.ustring.gsub(s, '%$%$', '$')
s = mw.ustring.gsub(s, '%$%x%x%x?', '')
s = mw.ustring.gsub(s, '%$[lh]%[[^%]]*%]', '')
s = mw.ustring.gsub(s, '%$[lh]%[', '')
s = mw.ustring.gsub(s, '%$.', '')
return s
end
return p