diff options
author | Andrey Makarov <ph.makarov@gmail.com> | 2022-09-09 17:45:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-09 10:45:54 -0400 |
commit | f6ee066ee2576757bd21071e046c9228bbb57552 (patch) | |
tree | 5e7374b512fb375a2db871fcc490fa1d28b562c9 /lib/packages/docutils | |
parent | 89e6540fd3a924c387defe2bf7648ebc653c2418 (diff) | |
download | Nim-f6ee066ee2576757bd21071e046c9228bbb57552.tar.gz |
Markdown links migration part 1 (#20319)
Markdown link migration part 1 Also the warning is improved a bit. Local links (targeting inside its document) which had had a full anchor were turned into concise form. The very fact that they existed may be due to the bug in reference to subsections fixed https://github.com/nim-lang/Nim/pull/20279, now they are working well (both in RST syntax and new Pandoc Markdown syntax implemented in https://github.com/nim-lang/Nim/pull/20304)
Diffstat (limited to 'lib/packages/docutils')
-rw-r--r-- | lib/packages/docutils/rst.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/packages/docutils/rst.nim b/lib/packages/docutils/rst.nim index 8ea2b56f3..0a997ecba 100644 --- a/lib/packages/docutils/rst.nim +++ b/lib/packages/docutils/rst.nim @@ -3578,7 +3578,7 @@ proc resolveLink(s: PRstSharedState, n: PRstNode) : PRstNode = target: newLeaf(subst.refname), info: subst.info, tooltip: subst.tooltip) foundLinks.sort(cmp = cmp, order = Descending) - let linkText = addNodes(desc) + let aliasStr = addNodes(alias) if foundLinks.len >= 1: let kind = if foundLinks[0].ar == arHyperlink: rnHyperlink elif foundLinks[0].ar == arNim: rnNimdocRef @@ -3598,10 +3598,10 @@ proc resolveLink(s: PRstSharedState, n: PRstNode) : PRstNode = targets.add t rstMessage(s.filenames, s.msgHandler, n.info, mwAmbiguousLink, "`$1`\n clash:\n$2" % [ - linkText, targets.join("\n")]) + aliasStr, targets.join("\n")]) else: # nothing found result = n - rstMessage(s.filenames, s.msgHandler, n.info, mwBrokenLink, linkText) + rstMessage(s.filenames, s.msgHandler, n.info, mwBrokenLink, aliasStr) proc resolveSubs*(s: PRstSharedState, n: PRstNode): PRstNode = ## Makes pass 2 of RST parsing. |