Nim/lib/packages/docutils
Andrey Makarov de9cbf6af1
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.
2022-08-27 17:28:26 -04:00
..
dochelpers.nim bootstrap the compiler with nimPreviewSlimSystem (#20176) 2022-08-09 16:32:29 +08:00
docutils.nimble.old remove docutils.nimble (not a real nimble package, and affected canonical imports) (#17544) 2021-03-29 12:46:53 +02:00
highlite.nim bootstrap the compiler with nimPreviewSlimSystem (#20176) 2022-08-09 16:32:29 +08:00
rst.nim Fix auto links to subheader when TOC is present (#20279) 2022-08-27 17:28:26 -04:00
rstast.nim bootstrap the compiler with nimPreviewSlimSystem (#20176) 2022-08-09 16:32:29 +08:00
rstgen.nim Fix auto links to subheader when TOC is present (#20279) 2022-08-27 17:28:26 -04:00