diff options
author | flywind <43030857+xflywind@users.noreply.github.com> | 2020-12-17 14:14:16 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-17 21:14:16 +0100 |
commit | 5d8f862bc644e1db076e7e8cc8a2fe8c99009329 (patch) | |
tree | 691f173ee611a20877a5e80e96330c7d3d663d47 /tools/dochack | |
parent | e1e069dd6c4e3439ee568686a2aed0a58bd771b0 (diff) | |
download | Nim-5d8f862bc644e1db076e7e8cc8a2fe8c99009329.tar.gz |
fix #16364 (#16379) [backport]
* fix #16364 * add comments * Update tools/dochack/dochack.nim Co-authored-by: Clyybber <darkmine956@gmail.com> Co-authored-by: Clyybber <darkmine956@gmail.com>
Diffstat (limited to 'tools/dochack')
-rw-r--r-- | tools/dochack/dochack.nim | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/dochack/dochack.nim b/tools/dochack/dochack.nim index 471212a50..4a491cf88 100644 --- a/tools/dochack/dochack.nim +++ b/tools/dochack/dochack.nim @@ -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 |