MediaWiki, the software used on Wikipedia, has some cool functionality as part of its header text syntax. It makes a slug out of the text, and automatically adds that slug to the id attribute of the header tag.

Example: https://en.wikipedia.org/wiki/URL#History

It would be great if the header tags here (i.e. ###) did the same thing.

Imagine - linking straight to the Copy Editor badge description in What are the badges I can earn on each site, and what are the exact criteria for earning each badge?! Or straight to Moderator in the Stack Exchange Glossary - Dictionary of Commonly-Used Terms!

  • Why is this more useful than just a "link"? Why should headers be links specifically? You can make links bold, or highlighted in other ways.
    – James
    Sep 15 '15 at 2:23
  • 6
    @James What I am suggesting is to make headers link targets, so that off-site links (or other questions/answers) can target headers directly. (Notice I can't do so in the body of the question to the headers mentioned.) What kind of "link" are you comparing this to?
    – Nicole
    Sep 15 '15 at 3:01

One of the comments asked about clarification on why this should be implemented.

SE already has direct links to questions, answers, and comments, but after that, navigation gets fuzzy.

For small posts, this isn't a problem. It's easy to scroll down and find the relevant chunks of information. However, for the bigger ones, where there's lots of text, it's easy to miss parts, or it overall takes time finding the relevant description. For bigger posts, where the user might just be looking for one part of the post, this could also be used to add table of contents (manually - this isn't desired everywhere), or otherwise make jumping to the relevant part easier

The question itself mentions linking straight to a badge description in the badge list, but this can be applied further. One perfect example off the top of my head is the SEDE schema post. Because of the way it's written, it takes a lot of space, and text everywhere makes it hard to navigate.

If this feature request was implemented, users could copy links straight to i.e. ReviewTasks, and the post could get a built-in table of contents, making it easier to navigate when a specific part of that answer is needed elsewhere. This isn't the only post where that applies either. Essentially any of the massive posts, including those in the question, would benefit from direct linking.

I imagine one of the concerns is ID overlap - which is a perfectly valid concern. But if the ID is prepended with the post ID (for an instance, a link to the investor badge in the badge list would look like https://meta.stackexchange.com/questions/67397/#67399-investor).

A second reason it should be implemented is because even with headers standing out, when there are a lot of them, and a lot of text, it can still be easy to miss them. Especially if there's a mix of several headers (i.e. h1 with h2 and h3 nearby).

  • 3
    the main problem is that Common mark (the markdown version SE will end-up on) has not yet settled on how to markup fragment identifiers: talk.commonmark.org/t/anchors-in-markdown/247/32 and as such it isn't yet in the spec and when it does I hope they get it right so it will work on SE when each post starts using id's in the markdown.
    – rene
    May 19 '19 at 16:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .