Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rstgen: Unique reference names in TOC #2332

Merged
merged 1 commit into from
Mar 16, 2015
Merged

Conversation

def-
Copy link
Member

@def- def- commented Mar 13, 2015

- Fixes nim-lang#2269
- Keeps track of higher level section to create unique reference names
Araq added a commit that referenced this pull request Mar 16, 2015
rstgen: Unique reference names in TOC
@Araq Araq merged commit 169e891 into nim-lang:devel Mar 16, 2015
a-mr added a commit to a-mr/Nim that referenced this pull request Aug 27, 2022
It was observed (in nim-lang#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 nim-lang#2332
in 2015, that is it is present in Nim 1.0.
Varriount pushed a commit that referenced this pull request Aug 27, 2022
Fix links to subheader when TOC is present

It was observed (in #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 #2332
in 2015, that is it is present in Nim 1.0.
capocasa pushed a commit to capocasa/Nim that referenced this pull request Mar 31, 2023
Fix links to subheader when TOC is present

It was observed (in nim-lang#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 nim-lang#2332
in 2015, that is it is present in Nim 1.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Links in lib.html don't work when 2 headers have the same name
2 participants