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 anchor after heading text #3

Closed
danielgtaylor opened this issue May 27, 2015 · 2 comments
Closed

Add anchor after heading text #3

danielgtaylor opened this issue May 27, 2015 · 2 comments

Comments

@danielgtaylor
Copy link

Right now, the anchor is always added before the heading text:

<!-- Currently -->
<h1><a href="...">P</a>I am a header</h1>

<!-- What I would like to see -->
<h1>I am a header<a href="...">P</a></h1>

This makes is easy to hide the anchor until mouse over and doesn't require shifting headings outside of their container to keep alignment on the left side (for LTR text). Ultimately it should probably just be an option.

Is this something you'd be willing to add? Otherwise I think this plugin is great!

@valeriangalliat
Copy link
Owner

Agreed.

Initially, I put it before the heading because I wanted to mimic how GitHub renders anchors in Markdown files, but it indeed requires some styling to look decent.

I think putting the anchor after the header would be a more sensible default (and it would be consistent with how Python Markdown is doing with the permalink option). Having the anchor before the header should still be possible with an option.

Since this is a breaking change I'm releasing 2.0.0 with this feature.

@danielgtaylor
Copy link
Author

@valeriangalliat thanks!

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