From de8cb0a1cf06d091dbe586fed85fb1cf904a33ac Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Fri, 28 Sep 2018 12:37:10 -0400 Subject: 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. --- nimdoc/testproject/expected/subdir/subdir_b/utils.html | 8 +++++--- nimdoc/testproject/expected/testproject.html | 18 +++++++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) (limited to 'nimdoc') diff --git a/nimdoc/testproject/expected/subdir/subdir_b/utils.html b/nimdoc/testproject/expected/subdir/subdir_b/utils.html index 285d09d5c..d81be8f48 100644 --- a/nimdoc/testproject/expected/subdir/subdir_b/utils.html +++ b/nimdoc/testproject/expected/subdir/subdir_b/utils.html @@ -1250,7 +1250,7 @@ function main() {
  • Procs @@ -1265,7 +1265,8 @@ function main() {

    Types

    -
    SomeType = enum
    +
    +
    SomeType = enum
       enumValueA, enumValueB, enumValueC
    @@ -1276,7 +1277,8 @@ function main() {

    Procs

    -
    proc someType(): SomeType {...}{.raises: [], tags: [].}
    + +
    proc someType(): SomeType {...}{.raises: [], tags: [].}
    constructor. diff --git a/nimdoc/testproject/expected/testproject.html b/nimdoc/testproject/expected/testproject.html index 064a70011..f1c567627 100644 --- a/nimdoc/testproject/expected/testproject.html +++ b/nimdoc/testproject/expected/testproject.html @@ -1255,7 +1255,7 @@ function main() {
  • Procs @@ -1263,7 +1263,7 @@ function main() {
  • Macros @@ -1271,7 +1271,7 @@ function main() {
  • Templates @@ -1297,7 +1297,8 @@ function main() {

    Vars

    -
    aVariable: array[1, int]
    + +
    aVariable: array[1, int]
    @@ -1307,7 +1308,8 @@ function main() {

    Procs

    -
    proc bar[T](a, b: T): T
    + +
    proc bar[T](a, b: T): T
    @@ -1317,7 +1319,8 @@ function main() {

    Macros

    -
    macro bar(): untyped
    + +
    macro bar(): untyped
    @@ -1327,7 +1330,8 @@ function main() {

    Templates

    -
    template foo(a, b: SomeType)
    + +
    template foo(a, b: SomeType)
    This does nothing -- cgit 1.4.1-2-gfad0