-
Notifications
You must be signed in to change notification settings - Fork 71
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
Possible feature? target anchor rather than header id #36
Comments
@valeriangalliat any thoughts about this?! This code smells... specially the |
That particular line was a hack of mine. Please disregard for the purposes of this proposal. Here's code for renderTargetLink
here are the defaults for the new properties:
here's the target-anchor class
So, the point is, the permalink goes after the target anchor when selected, which places the link 64p below the link to leave room for the fixed title. (I use |
It turns out that the best way to handle a fixed top toolbar for anchors (ie creating a top offset to avoid scrolling to a position under the toolbar), is to use a target anchor rather than a header id for the target.
So I've forked
markdown-it-anchor
to accommodate that. Thought you might be interested.Basically: I've modified the processing logic as follows:
some new options:
To create the renderTargetLink I just copied and modified your renderPermalink.
Congrats on a well-written utility! It was very straightforward to fork and extend it.
Just thought you might be interested in case you want to accommodate this use case in your excellent plugin.
The text was updated successfully, but these errors were encountered: