summary refs log tree commit diff stats
path: root/config
diff options
context:
space:
mode:
authorKaushal Modi <kaushal.modi@gmail.com>2018-09-28 12:37:10 -0400
committerKaushal Modi <kaushal.modi@gmail.com>2018-09-28 13:52:54 -0400
commitde8cb0a1cf06d091dbe586fed85fb1cf904a33ac (patch)
treee1758ef5b70b2d1d7d27ad63d0f3cf2df4adea5a /config
parent99a874cc8af70db58da0f3e5e00c318488c6c3ea (diff)
downloadNim-de8cb0a1cf06d091dbe586fed85fb1cf904a33ac.tar.gz
Encode non-alphanum chars like %, + in URLs in the docs
Use $itemSymOrIDEnc instead of $itemSymOrID in the id and href attr in
a tags.

Fixes https://github.com/nim-lang/Nim/issues/9097.

Thanks to @LemonBoy for helping with this commit.

---

Update the tests too -- "nim c -r nimdoc/tester" passes.
Diffstat (limited to 'config')
-rw-r--r--config/nimdoc.cfg5
1 files changed, 3 insertions, 2 deletions
diff --git a/config/nimdoc.cfg b/config/nimdoc.cfg
index 96e91283a..960c58c9e 100644
--- a/config/nimdoc.cfg
+++ b/config/nimdoc.cfg
@@ -38,7 +38,8 @@ doc.section.toc = """
 # * $seeSrc: generated HTML from doc.item.seesrc (if some switches are used).
 
 doc.item = """
-<dt id="$itemSym"><a name="$itemSymOrID"></a><pre>$header</pre></dt>
+<a id="$itemSymOrIdEnc"></a>
+<dt><pre>$header</pre></dt>
 <dd>
 $desc
 $seeSrc
@@ -48,7 +49,7 @@ $seeSrc
 # Chunk of HTML emitted for each entry in the HTML table of contents.
 # See doc.item for available substitution variables.
 doc.item.toc = """
-  <li><a class="reference" href="#$itemSymOrID"
+  <li><a class="reference" href="#$itemSymOrIDEnc"
     title="$header_plain">$name<span class="attachedType" style="visibility:hidden">$attype</span></a></li>
 """