summary refs log tree commit diff stats
path: root/lib/pure/xmltree.nim
diff options
context:
space:
mode:
authorErwan Ameil <wan@idlewan.com>2014-08-30 22:21:38 +0200
committerErwan Ameil <wan@idlewan.com>2014-08-30 22:21:38 +0200
commit05c1fb060fce7402541f625fe1dabb6ed30b6d48 (patch)
tree780e14996b2075874d3214e884df670d0c5eb1e6 /lib/pure/xmltree.nim
parent3a00692ef88fd7c15c201e52cc376b373ee5d9a0 (diff)
downloadNim-05c1fb060fce7402541f625fe1dabb6ed30b6d48.tar.gz
Escape ' and / when using escape in xmltree
Diffstat (limited to 'lib/pure/xmltree.nim')
-rw-r--r--lib/pure/xmltree.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pure/xmltree.nim b/lib/pure/xmltree.nim
index 95b48a850..1af7db7d5 100644
--- a/lib/pure/xmltree.nim
+++ b/lib/pure/xmltree.nim
@@ -151,6 +151,8 @@ proc addEscaped*(result: var string, s: string) =
     of '>': result.add("&gt;")
     of '&': result.add("&amp;")
     of '"': result.add("&quot;")
+    of '\'': result.add("&#x27;")
+    of '/': result.add("&#x2F;")
     else: result.add(c)
 
 proc escape*(s: string): string = 
@@ -164,6 +166,8 @@ proc escape*(s: string): string =
   ##  ``>``          ``&gt;``
   ##  ``&``          ``&amp;``
   ##  ``"``          ``&quot;``
+  ##  ``'``          ``&#x27;``
+  ##  ``/``          ``&#x2F;``
   ## ------------    -------------------
   result = newStringOfCap(s.len)
   addEscaped(result, s)