From 05c1fb060fce7402541f625fe1dabb6ed30b6d48 Mon Sep 17 00:00:00 2001 From: Erwan Ameil Date: Sat, 30 Aug 2014 22:21:38 +0200 Subject: Escape ' and / when using escape in xmltree --- lib/pure/xmltree.nim | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/pure/xmltree.nim') 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) -- cgit 1.4.1-2-gfad0