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

Text Anchor Extension For Jump Marks #662

Closed
ramimassoud opened this issue Apr 11, 2020 · 5 comments
Closed

Text Anchor Extension For Jump Marks #662

ramimassoud opened this issue Apr 11, 2020 · 5 comments
Labels
Type: Feature The issue or pullrequest is a new feature

Comments

@ramimassoud
Copy link

Is your feature request related to a problem? Please describe.
I would love to be able to select text or a heading and mark it with an anchor that can be linked to.

Describe the solution you'd like
It would be great to have an extension/mark similar to Link that would allow selected text to have a specified id so it can be directly linked to.

Describe alternatives you've considered
N/A

Additional context
This might have some crossover with #621, but I'm not 100% sure

@ramimassoud ramimassoud added the Type: Feature The issue or pullrequest is a new feature label Apr 11, 2020
@jmartsch
Copy link

This is desperately needed

@aadind
Copy link

aadind commented Oct 5, 2020

Same! need anchor links!

@hanspagel
Copy link
Contributor

hanspagel commented Oct 5, 2020

I think you can add the code from #621 as a custom extension (instead of the default heading extension) and then add links to the ids (href="#6372727").

You would probably want to loop through the JSON (editor.getJSON()) to get a list of existing IDs in your document.

Hope that helps!

@wiwat-p
Copy link

wiwat-p commented Jul 22, 2021

Are we have example

@mackmm145
Copy link

here's a quick and dirty jump anchor extension that creates a span with an id in case anyone runs into a similar situation.

https://gist.github.com/mackmm145/f100a62de841464872785e3d041be13f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature The issue or pullrequest is a new feature
Projects
None yet
Development

No branches or pull requests

6 participants