Merge pull request #10622 from ehmry/xml

Use standard XML escaping
This commit is contained in:
LemonBoy 2019-02-10 19:33:59 +01:00 • committed by GitHub
commit c5dc46926c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -492,8 +492,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 =
@ -508,8 +507,7 @@ proc escape*(s: string): string =
## ``>`` ``>``
## ``&`` ``&``
## ``"`` ``"``
## ``'`` ``'``
## ``/`` ``/``
## ``'`` ``'``
## ------------ -------------------
##
## You can also use `addEscaped proc <#addEscaped,string,string>`_.