Skip to content

Commit

Permalink
Use standard XML escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmry committed May 14, 2019
1 parent 8bd7336 commit cd6b947
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/pure/xmltree.nim
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ proc addEscaped*(result: var string, s: string) =
of '>': result.add(">")
of '&': result.add("&")
of '"': result.add(""")
of '\'': result.add("'")
of '/': result.add("/")
of '\'': result.add("'")
else: result.add(c)

proc escape*(s: string): string =
Expand All @@ -211,8 +210,7 @@ proc escape*(s: string): string =
## ``>`` ``>``
## ``&`` ``&``
## ``"`` ``"``
## ``'`` ``'``
## ``/`` ``/``
## ``'`` ``'``
## ------------ -------------------
result = newStringOfCap(s.len)
addEscaped(result, s)
Expand Down

0 comments on commit cd6b947

Please sign in to comment.