11
submitted 23 hours ago by Lumini@lemmy.world to c/asklemmy@lemmy.world

I'm trying to figure out how to do this in markdown on here. How do you create a link that jumps(scrolls) to that heading in the post when clicked on?

top 6 comments
sorted by: hot top controversial new old
[-] Ensign_Seitler@startrek.website 2 points 22 hours ago* (last edited 22 hours ago)

This involves some HTML in your Markdown, but isn’t very difficult. You’re just going to add an anchor tag (with an ID but no href) immediately above the heading, like so:

<a id=“some_examples”></a>
## Some Examples

When you’ve got that, you can just use the anchor in a Markdown link:

I’ve provided a few [examples](#some_examples) to illustrate this concept.
[-] Lumini@lemmy.world 2 points 22 hours ago

I think I'm doing it wrong since its still not working, can the ID be anything? The HTML is still visible over the heading when saved for some reason

[-] can@sh.itjust.works 2 points 23 hours ago* (last edited 23 hours ago)
[-] Lumini@lemmy.world 2 points 22 hours ago

I still don't know how to do it?

[-] can@sh.itjust.works 1 points 22 hours ago* (last edited 22 hours ago)

Me neither. You're sure it's possible? Do you have an example post?

Edit: some more tests

[does this work](# test)

dolor

dolor sit amet, consectetur adipiscing elit. Nunc egestas accumsan neque sed aliquet. Aenean ultricies, augue a lacinia cursus, metus sem pulvinar lectus, nec tempor leo quam rhoncus nisl. Curabitur placerat mauris sapien, at suscipit odio volutpat eu. Suspendisse vestibulum, libero non varius auctor, augue dui pharetra erat, nec interdum augue arcu porttitor dui. Etiam quis mattis diam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Integer eros dui, auctor id interdum nec, sollicitudin eget arcu. Etiam metus purus, vehicula eu urna ut, rhoncus posuere libero.

Donec eu lobortis lectus. Quisque finibus nunc ut odio pharetra, quis ullamcorper elit elementum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac lorem non eros laoreet ullamcorper. Mauris at euismod leo. Vivamus laoreet laoreet orci, ac accumsan elit aliquet ut. Nulla sed neque ac nulla faucibus tempor. Cras quis tortor iaculis dui iaculis semper. Vivamus fermentum feugiat purus sit amet ultrices. Morbi eleifend sed nisi in hendrerit. In blandit orci ut rhoncus laoreet. Sed nisi mauris, cursus quis est bibendum, ullamcorper vulputate ante. Donec ut tristique sem. Fusce consequat diam a quam fringilla, vitae bibendum felis ultrices. Sed mi arcu, maximus sit amet finibus quis, convallis sit amet lacus.

Cras ut tortor ligula. Duis sollicitudin, lorem eget pharetra molestie, enim erat cursus mi, id pulvinar lorem leo at diam. Praesent convallis purus vulputate porttitor commodo. Praesent ut nibh euismod, rhoncus nibh id, varius est. Nunc posuere nisl non eleifend fermentum. Sed tincidunt a nisl at ultricies. Nullam sodales enim sem, eu rhoncus mi convallis vel. Vestibulum sed scelerisque ante. Maecenas auctor sem ac nunc varius laoreet. Curabitur in neque a massa fermentum suscipit. Phasellus posuere, nibh vitae egestas facilisis, orci nunc lobortis tortor, sit amet rhoncus odio risus id massa. Fusce egestas mi vitae vestibulum faucibus.

Fusce iaculis dui sit amet pulvinar cursus. Sed sodales ex risus, sed eleifend lorem aliquam eget. Donec dictum elementum accumsan. Donec et pellentesque velit, eget luctus tellus. Proin condimentum orci sit amet laoreet tempus. Morbi risus est, tincidunt in rhoncus in, hendrerit at libero. Sed lacinia ipsum eget vestibulum egestas. Vivamus consectetur ac felis id auctor. Donec tempus tellus orci, lobortis scelerisque massa consectetur vitae. Donec dignissim ex vitae lacus hendrerit vehicula. Sed id eleifend massa, nec rutrum neque.

Sed imperdiet, tellus eu consectetur interdum, ex erat varius libero, vel ullamcorper nisl lacus eu ipsum. Curabitur bibendum lorem at nibh blandit, eu iaculis metus efficitur. Donec placerat metus mattis magna cursus, nec elementum purus faucibus. Aliquam tristique nunc non lobortis feugiat. Donec vel commodo metus. Morbi convallis commodo elit, vel mattis lectus. In et ipsum a dui vestibulum pharetra id vel magna. Cras vestibulum dolor sed lacus accumsan aliquam.

sit

sit amet, consectetur adipiscing elit. Nunc egestas accumsan neque sed aliquet. Aenean ultricies, augue a lacinia cursus, metus sem pulvinar lectus, nec tempor leo quam rhoncus nisl. Curabitur placerat mauris sapien, at suscipit odio volutpat eu. Suspendisse vestibulum, libero non varius auctor, augue dui pharetra erat, nec interdum augue arcu porttitor dui. Etiam quis mattis diam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Integer eros dui, auctor id interdum nec, sollicitudin eget arcu. Etiam metus purus, vehicula eu urna ut, rhoncus posuere libero.

Donec eu lobortis lectus. Quisque finibus nunc ut odio pharetra, quis ullamcorper elit elementum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac lorem non eros laoreet ullamcorper. Mauris at euismod leo. Vivamus laoreet laoreet orci, ac accumsan elit aliquet ut. Nulla sed neque ac nulla faucibus tempor. Cras quis tortor iaculis dui iaculis semper. Vivamus fermentum feugiat purus sit amet ultrices. Morbi eleifend sed nisi in hendrerit. In blandit orci ut rhoncus laoreet. Sed nisi mauris, cursus quis est bibendum, ullamcorper vulputate ante. Donec ut tristique sem. Fusce consequat diam a quam fringilla, vitae bibendum felis ultrices. Sed mi arcu, maximus sit amet finibus quis, convallis sit amet lacus.

Cras ut tortor ligula. Duis sollicitudin, lorem eget pharetra molestie, enim erat cursus mi, id pulvinar lorem leo at diam. Praesent convallis purus vulputate porttitor commodo. Praesent ut nibh euismod, rhoncus nibh id, varius est. Nunc posuere nisl non eleifend fermentum. Sed tincidunt a nisl at ultricies. Nullam sodales enim sem, eu rhoncus mi convallis vel. Vestibulum sed scelerisque ante. Maecenas auctor sem ac nunc varius laoreet. Curabitur in neque a massa fermentum suscipit. Phasellus posuere, nibh vitae egestas facilisis, orci nunc lobortis tortor, sit amet rhoncus odio risus id massa. Fusce egestas mi vitae vestibulum faucibus.

Fusce iaculis dui sit amet pulvinar cursus. Sed sodales ex risus, sed eleifend lorem aliquam eget. Donec dictum elementum accumsan. Donec et pellentesque velit, eget luctus tellus. Proin condimentum orci sit amet laoreet tempus. Morbi risus est, tincidunt in rhoncus in, hendrerit at libero. Sed lacinia ipsum eget vestibulum egestas. Vivamus consectetur ac felis id auctor. Donec tempus tellus orci, lobortis scelerisque massa consectetur vitae. Donec dignissim ex vitae lacus hendrerit vehicula. Sed id eleifend massa, nec rutrum neque.

Sed imperdiet, tellus eu consectetur interdum, ex erat varius libero, vel ullamcorper nisl lacus eu ipsum. Curabitur bibendum lorem at nibh blandit, eu iaculis metus efficitur. Donec placerat metus mattis magna cursus, nec elementum purus faucibus. Aliquam tristique nunc non lobortis feugiat. Donec vel commodo metus. Morbi convallis commodo elit, vel mattis lectus. In et ipsum a dui vestibulum pharetra id vel magna. Cras vestibulum dolor sed lacus accumsan aliquam. Generated 5 paragraphs, 449 words, 3005 bytes of

test

123, I guess not

[-] Lumini@lemmy.world 1 points 22 hours ago

I just assumed it'd be possible here

this post was submitted on 07 Nov 2024
11 points (100.0% liked)

Ask Lemmy

26673 readers
1402 users here now

A Fediverse community for open-ended, thought provoking questions

Please don't post about US Politics.


Rules: (interactive)


1) Be nice and; have funDoxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them


2) All posts must end with a '?'This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?


3) No spamPlease do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.


4) NSFW is okay, within reasonJust remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either !asklemmyafterdark@lemmy.world or !asklemmynsfw@lemmynsfw.com. NSFW comments should be restricted to posts tagged [NSFW].


5) This is not a support community.
It is not a place for 'how do I?', type questions. If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email info@lemmy.world. For other questions check our partnered communities list, or use the search function.


Reminder: The terms of service apply here too.

Partnered Communities:

Tech Support

No Stupid Questions

You Should Know

Reddit

Jokes

Ask Ouija


Logo design credit goes to: tubbadu


founded 1 year ago
MODERATORS