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

add id attr directly in heading if possible #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

moy
Copy link

@moy moy commented Jan 2, 2017

Instead of generating a useless before the relevant
<h?> tag, just add the id attr to the <h?> tag if it does not have
one already.

This way, the target of the link is exactly the <h?> tag, and the
browser positions the focus exactly on it. Without this, there was a
slight difference in offset between tags which had an id= attr an
tags which didn't.

Instead of generating a useless <span id="..."> before the relevant
<h?> tag, just add the id attr to the <h?> tag if it does not have
one already.

This way, the target of the link is exactly the <h?> tag, and the
browser positions the focus exactly on it. Without this, there was a
slight difference in offset between tags which had an id= attr an
tags which didn't.
@patrickcate
Copy link

@moy Can you update this PR with the branch conflicts fixed?

@moy
Copy link
Author

moy commented Nov 8, 2019

I didn't follow the development, but apparently the new version doesn't have the drawback I fixed with this PR, so I guess we can just close without merging.

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.

2 participants