summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2016-09-09 20:42:02 +0200
committerAraq <rumpf_a@web.de>2016-09-09 20:42:02 +0200
commit3dfc86671005d033f6a7f3b68e0aeabeb1f4cfb9 (patch)
treeea250749d8b1b0ae4db6ad295a6143e1c6a96001 /lib
parent3a3aeb94ecf2b0a0f91470719f5e22dc6ff475c6 (diff)
downloadNim-3dfc86671005d033f6a7f3b68e0aeabeb1f4cfb9.tar.gz
docgen: working search feature
Diffstat (limited to 'lib')
-rw-r--r--lib/packages/docutils/rstgen.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/packages/docutils/rstgen.nim b/lib/packages/docutils/rstgen.nim
index 13c0c0a29..47247dd7c 100644
--- a/lib/packages/docutils/rstgen.nim
+++ b/lib/packages/docutils/rstgen.nim
@@ -419,10 +419,10 @@ proc escapeLink(s: string): string =
   result = newStringOfCap(s.len + s.len shr 2)
   for c in items(s):
     case c
-    of 'a'..'z', '_', 'A'..'Z', '0'..'9':
+    of 'a'..'z', '_', 'A'..'Z', '0'..'9', '.', '#', ',', '/':
       result.add c
     else:
-      add(result, "X")
+      add(result, "%")
       add(result, toHex(ord(c), 2))
 
 proc generateSymbolIndex(symbols: seq[IndexEntry]): string =
@@ -436,7 +436,7 @@ proc generateSymbolIndex(symbols: seq[IndexEntry]): string =
     var j = i
     while j < symbols.len and keyword == symbols[j].keyword:
       let
-        url = symbols[j].link.escapeLink #replace("&", "&amp;")
+        url = symbols[j].link.escapeLink
         text = if not symbols[j].linkTitle.isNil: symbols[j].linkTitle else: url
         desc = if not symbols[j].linkDesc.isNil: symbols[j].linkDesc else: ""
       if desc.len > 0: