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

If header starts with a number, scrollspy not works #64

Open
slamslam612 opened this issue Nov 7, 2019 · 2 comments
Open

If header starts with a number, scrollspy not works #64

slamslam612 opened this issue Nov 7, 2019 · 2 comments

Comments

@slamslam612
Copy link

slamslam612 commented Nov 7, 2019

If header starts with a number, script creates an id with a number at the beginning, which is wrong. In html id can't start with a number. It would also be nice to strip all html entities (e.g. &) from id.

@slambert
Copy link

slambert commented Jan 6, 2020

I just noticed this as well.

For some reason this was ok:
<h2 id="2016aidsheader" class="pt-5">2016 AIDS Conference</h2>

But this, nested within another h2 was not:

<h3>508 Memorial</h3>

¯_(ツ)_/¯

@BoPeng
Copy link

BoPeng commented Apr 11, 2020

I might be experiencing something similar as scrollspy does not pass the sections with parenthesis on page https://bioworkflows.com/ictr/COVID19-outbreak-simulator-model/2 .

Edit: I think I encountered the same problem with this stackoverflow post. The problem is that the IDs are generated by bootstrap-toc, not by me, so it should perhaps remove ( and ) in the first place.

Edit: It turns out that the document came with IDs that contains ( and ), in which case bootstrap-toc will simply use existing IDs. I think what bootstrap-toc is doing is correct because the IDs might be used by the document, but scrollspy does fail to work because of this. I have tried to fix it by adjusting the ID in the document.

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

3 participants