diff options
author | Erwan Ameil <wan@idlewan.com> | 2014-08-30 22:21:38 +0200 |
---|---|---|
committer | Erwan Ameil <wan@idlewan.com> | 2014-08-30 22:21:38 +0200 |
commit | 05c1fb060fce7402541f625fe1dabb6ed30b6d48 (patch) | |
tree | 780e14996b2075874d3214e884df670d0c5eb1e6 /lib/pure/xmltree.nim | |
parent | 3a00692ef88fd7c15c201e52cc376b373ee5d9a0 (diff) | |
download | Nim-05c1fb060fce7402541f625fe1dabb6ed30b6d48.tar.gz |
Escape ' and / when using escape in xmltree
Diffstat (limited to 'lib/pure/xmltree.nim')
-rw-r--r-- | lib/pure/xmltree.nim | 4 |
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(">") of '&': result.add("&") of '"': result.add(""") + of '\'': result.add("'") + of '/': result.add("/") else: result.add(c) proc escape*(s: string): string = @@ -164,6 +166,8 @@ proc escape*(s: string): string = ## ``>`` ``>`` ## ``&`` ``&`` ## ``"`` ``"`` + ## ``'`` ``'`` + ## ``/`` ``/`` ## ------------ ------------------- result = newStringOfCap(s.len) addEscaped(result, s) |