Use-case: Intra-Question and Intra-Answer Linking
As a user posting either Questions or Answers, I would like to be able to add a link within that Question or Answer to another heading within that, or different, question.
Use-Case: Allow Linking from comments to specific headings within a Question or Answer
As a user, I need to be able to link to headings within both Questions and Answers, while also allowing hyperlinks to those headings from within comments, or use those links outside of the StackExchange ecosystem very similar to the share links on Questions or Answers themselves (e.g., links to questions such as Is there a way to hyperlink within an answer? or to answers such as https://meta.askubuntu.com/a/924/340383).
Justification
Without this feature, various expensive-to-the-users workarounds are required: As a question poster, I have to say "see Update 4" which means the user has to search the question text to find that section. That workaround wastes roughly O(n) user time either:
- Re-reading the entire question/answer, looking for "Update 4", or
- Avoid re-reading the entire question/answer, but then using the browsers CTRL-F and retyping "Update 4 " which is also O(n) time which is more burdensome than a single click on a link pointing to that heading.
This manual searching is required in this context, not due to the character size of the post itself per se, but because that the addition of valuable screenshots in Questions and Answers consumes browser page "real-estate" (user has to page up and down to find the referenced heading).
See How to enable Hide Top Bar Gnome Extension so that it hides the Top Bar? as a real-world example, that started out short and concise, but commenters revealed that it was more involved, and required additional real-estate-consuming screenshots and details. This resulted in posting several "Updates" into separate heading sections, each with additional screenshots.
Refer to https://meta.askubuntu.com/a/924/340383 where the comment was made:
No, there is no way to do footnoting or anchoring within a post at the moment.
We have a post size limit of 30,000 chars which is a lot, but not so much that IMHO you'd really need such things. And most posts, even larger posts, are nowhere near 30k chars.
As of "Update 5", the Question at How to enable Hide Top Bar Gnome Extension so that it hides the Top Bar? had a total character count of 3614. 3614 is significantly less than the 30000 character limit referenced in https://meta.askubuntu.com/a/924/340383, so the size limit aspect is, IMO, not a significant objection to implementing this feature in this context, because of the screenshots that consume vertical web page "real-estate", requiring the user to page up and down to find referenced material.
Suggested Implementation
https://stackoverflow.com/a/33708270/257924 might be a clean and/or low-cost approach to implement this feature, but with the important addition of allowing linking to specific sections from within comments. This would allow the user to add a comment of the form:
I have updated my question with the supplied information at INSERT_LINK_SYNTAX_HERE
I would like to hover over my mouse cursor somewhere over, or near, the heading in that Question or Answer, and use the browsers right-mouse-click context menu to copy the link of that particular heading, and paste it into the comment.
GitHub-based Markdown browser rendering allows for this. For example, hover your mouse over the left of Helm interaction model at https://github.com/emacs-helm/helm/wiki#helm-interaction-model and a link is presented as a link icon: . I can then use the right-mouse-click context menu in my browser on the link icon, and select "Copy Link Location", and then paste that into the comment as literally:
https://github.com/emacs-helm/helm/wiki#general-helm-commands
Of course, in the context of StackExchange Sites, the above URL would change into one that would avoid link-rot, unless the question was subsequently modified by changing the heading text, in which case the resulting link-rot is surely user error.
Intra-Question or Intra-Answer heading references should still be allowed using syntax such as mentioned in https://stackoverflow.com/a/33708270/257924 as:
So you can link to it simply by [My link](#my-header)
Using hash-based permalinks similar to Atlassian Confluence short URL's or Google Drive sharable links might be overkill for these use-cases.