[awful] Fix a bug in escape(), add unescape

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-06-11 15:49:57 +02:00
parent 35e83ddfa6
commit f0131d985d
1 changed files with 10 additions and 1 deletions

View File

@ -469,11 +469,20 @@ local function escape(text)
text = text:gsub("&", "&amp;")
text = text:gsub("<", "&lt;")
text = text:gsub(">", "&gt;")
text = text:gsub("\\", "&apos;")
text = text:gsub("'", "&apos;")
text = text:gsub("\"", "&quot;")
return text
end
local function unescape(text)
text = text:gsub("&amp;", "&")
text = text:gsub("&lt;", "<")
text = text:gsub("&gt;", ">")
text = text:gsub("&apos;", "'")
text = text:gsub("&quot;", "\"")
return text
end
-- Export tags function
P.tag =
{