diff options
author | Andrey Makarov <ph.makarov@gmail.com> | 2022-08-28 00:28:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-27 17:28:26 -0400 |
commit | de9cbf6af1b3e67ceb78c4fd02c88b48fe762fa8 (patch) | |
tree | 5dfb0b2b90b3f6814ef2a36df650d90dacf39af9 /tests/stdlib/trst.nim | |
parent | 9ca63451227c879c573c280e582ca51af034be9d (diff) | |
download | Nim-de9cbf6af1b3e67ceb78c4fd02c88b48fe762fa8.tar.gz |
Fix auto links to subheader when TOC is present (#20279)
Fix links to subheader when TOC is present It was observed (in https://github.com/nim-lang/Nim/pull/20112) that links to 2nd- (and subsequent) -level headings fail if TOC is present, e.g.: ```nim .. contents:: Type relations ============== Convertible relation -------------------- Ref. `Convertible relation`_ ``` The problem here is that links are resolved in `rst.nim` but later `rstgen.nim` fixes ("fixes") anchors to make them unique so that TOC always works (if e.g. there was another sub-section like "Convertible relation"). The solution implemented in this PR is to move that fix-up of anchors into `rst.nim`, so that link resolution could know final anchors. The bug seems to be added in https://github.com/nim-lang/Nim/pull/2332 in 2015, that is it is present in Nim 1.0.
Diffstat (limited to 'tests/stdlib/trst.nim')
-rw-r--r-- | tests/stdlib/trst.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/stdlib/trst.nim b/tests/stdlib/trst.nim index d1d7a3f00..32917d257 100644 --- a/tests/stdlib/trst.nim +++ b/tests/stdlib/trst.nim @@ -74,7 +74,7 @@ suite "RST parsing": """.toAst == dedent""" rnInner - rnHeadline level=1 + rnHeadline level=1 anchor='lexical-analysis' rnLeaf 'Lexical' rnLeaf ' ' rnLeaf 'Analysis' |