summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorMiran <narimiran@disroot.org>2019-03-20 11:23:38 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-03-20 11:23:38 +0100
commit54151ce3986d76313a5b77712f80e7739bb32dc0 (patch)
treeaf85f492d84a349b561c140506402d4d784613bb /compiler
parent1eefbf6da89377218b64f1b846e9dba76a164356 (diff)
downloadNim-54151ce3986d76313a5b77712f80e7739bb32dc0.tar.gz
docgen: add links for var, let and const (refs #10487) (#10868)
* docgen: add links for var, let and const (refs #10487)

* change the expected html
Diffstat (limited to 'compiler')
-rw-r--r--compiler/docgen.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim
index 34baacfb9..2c7e52c67 100644
--- a/compiler/docgen.nim
+++ b/compiler/docgen.nim
@@ -344,9 +344,9 @@ proc nodeToHighlightedHtml(d: PDoc; n: PNode; result: var Rope; renderFlags: TRe
       if procTokenPos == tokenPos-2 and procLink != nil:
         dispA(d.conf, result, "<a href=\"#$2\"><span class=\"Identifier\">$1</span></a>",
               "\\spanIdentifier{$1}", [rope(esc(d.target, literal)), procLink])
-      elif s != nil and s.kind == skType and sfExported in s.flags and
-          s.owner != nil and belongsToPackage(d.conf, s.owner) and
-          d.target == outHtml:
+      elif s != nil and s.kind in {skType, skVar, skLet, skConst} and
+           sfExported in s.flags and s.owner != nil and
+           belongsToPackage(d.conf, s.owner) and d.target == outHtml:
         let external = externalDep(d, s.owner)
         result.addf "<a href=\"$1#$2\"><span class=\"Identifier\">$3</span></a>",
           [rope changeFileExt(external, "html"), rope literal,