Add a button while hovering a id to generate a link with anchor (ala GitHub)



4 years ago
10 months ago


(Reporter: sphinx_knight, Unassigned)



(Whiteboard: [specification][type:feature])


(2 attachments)



4 years ago
What problems would this solve?
This would make easier for readers to create link towards specific points in MDN articles. Currently, only heading element from the ToC can generate such links though some other elements have IDs.

Who would use this?
Readers of the page who want to generate a link to a specific point in the page (non necessarily a heading element) in order to share/reference it.

What would users see?
Users will see a link button while hovering the element of the page to link too (cf. GitHub which does this)

What would users do? What would happen as a result?
Users would be able to click on this button to get the URL to be exactly the one corresponding to this point in the page (whether it's in the URL bar or in the clipboard) 
For example, they could create withouth going through the dev tools looking for the ID.

A user receiving such a link would be directly sent to the exact point of the page related to the info.

Is there anything else we should know?
This has been a real user case explained on IRC. This feature could be inspired from the one that is already in GitHub.


4 years ago
Component: General → Design

Comment 1

4 years ago
Created attachment 8588419 [details]
Feature on

Comment 2

4 years ago
Created attachment 8588420 [details]
Feature on GitHub

Comment 3

4 years ago
To be noted: github feature only works on headers. It indeed doesn't make sense to have a link to the middle of a paragraph.

Hence, I think this feature should be added for:

- <h*> (whether in the ToC or not)
- <dt>

... and maybe others I haven't thought about.
The New York times has a way to do this that doesn't involve generating IDs but the links expire if the text is changed significantly: 

What Julien is describing is certainly the more familiar UI pattern and probably would be easier to make work without javascript.
Severity: normal → enhancement
Component: Design → Wiki pages
Ever confirmed: true
See Also: → bug 1307217
You need to log in before you can comment on or make changes to this bug.