summaryrefslogtreecommitdiff
path: root/xmpp/xml.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp/xml.lua')
-rw-r--r--xmpp/xml.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/xmpp/xml.lua b/xmpp/xml.lua
index 68fa741..e54f27f 100644
--- a/xmpp/xml.lua
+++ b/xmpp/xml.lua
@@ -1,21 +1,20 @@
-- originally from http://lua-users.org/wiki/LuaXml
-- modified by me a bit
-
-entity_escapes = {
+local entity_escapes = {
["<"]="&lt;",
[">"]="&gt;",
["&"]="&amp;",
['"']="&quot;",
["'"]="&apos;"
}
-entity_unescapes = {}
+local entity_unescapes = {}
for k,v in pairs(entity_escapes) do entity_unescapes[v]=k end
-function escape(s)
+local function escape(s)
return s:gsub("[<>&'\"]",entity_escapes)
end
-function unescape(s)
+local function unescape(s)
return s:gsub("&[a-z]+;",entity_unescapes)
end