Escape ' and / when using escape in xmltree
This commit is contained in:
parent
3a00692ef8
commit
05c1fb060f
1 changed files with 4 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue