mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
* fix #16364 * add comments * Update tools/dochack/dochack.nim Co-authored-by: Clyybber <darkmine956@gmail.com> Co-authored-by: Clyybber <darkmine956@gmail.com>
This commit is contained in:
@@ -268,15 +268,13 @@ var
|
||||
template normalize(x: cstring): cstring = x.toLower.replace("_", "")
|
||||
|
||||
proc escapeCString(x: var cstring) =
|
||||
# Original strings are already escaped except HTML tags, so
|
||||
# we only escape `<` and `>`.
|
||||
var s = ""
|
||||
for c in x:
|
||||
case c
|
||||
of '&': s.add("&")
|
||||
of '<': s.add("<")
|
||||
of '>': s.add(">")
|
||||
of '"': s.add(""")
|
||||
of '\'': s.add("'")
|
||||
of '/': s.add("/")
|
||||
else: s.add(c)
|
||||
x = s.cstring
|
||||
|
||||
|
||||
Reference in New Issue
Block a user