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

bug: doctoc does not respect "id" attribute of headers when constructing the TOC #198

Open
flisboac opened this issue May 1, 2021 · 1 comment

Comments

@flisboac
Copy link

flisboac commented May 1, 2021

When I try to generate TOC for a file that starts like such:

<!-- START doctoc -->
<!-- END doctoc -->

# Test 1

<h1 id="test-a">Test á</a>

I'd expect doctoc to generate a second TOC entry that respects the explicit "id":

<!-- START doctoc -->
- [Test 1](#test-1)
- [Test á](#test-a)
<!-- END doctoc -->

# Test 1

<h1 id="teste-a">Teste á</h1>

Instead, I get an autogenerated slug regardless:

<!-- START doctoc -->
- [Test 1](#test-1)
- [Test á](#test-%C3%A1)
<!-- END doctoc -->

# Test 1

<h1 id="teste-a">Teste á</h1>

Is that correct? If not, how difficult would it be for a fix to be made? I can help, if someone points me to the right places.

@AndrewSouthpaw
Copy link
Collaborator

Seems like a reasonable assumption to make, and sounds like it could be an improvement!

The codebase is pretty small, I think here would be a decent place to begin your investigation.

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

No branches or pull requests

2 participants