summary refs log tree commit diff stats
path: root/tools/dochack
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-12-17 14:14:16 -0600
committerGitHub <noreply@github.com>2020-12-17 21:14:16 +0100
commit5d8f862bc644e1db076e7e8cc8a2fe8c99009329 (patch)
tree691f173ee611a20877a5e80e96330c7d3d663d47 /tools/dochack
parente1e069dd6c4e3439ee568686a2aed0a58bd771b0 (diff)
downloadNim-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.nim6
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("&amp;")
     of '<': s.add("&lt;")
     of '>': s.add("&gt;")
-    of '"': s.add("&quot;")
-    of '\'': s.add("&#039;")
-    of '/': s.add("&#x2F;")
     else: s.add(c)
   x = s.cstring