Closed Bug 788548 Opened 12 years ago Closed 4 years ago

Kuma: Editor - link editor can't find sections in the page for linking to them

Categories

(developer.mozilla.org Graveyard :: Editing, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: sheppy, Unassigned)

References

Details

When you try to edit a link to an anchor within the same document, you get a box that lets you pick the link type and an anchor within the document -- but the list of anchors is empty.

See https://developer.mozilla.org/en-US/docs/Mozilla/WebIDL_bindings for example; find "methods that are allowed to throw", which is a link to an anchor.
It appears the anchor button is only looking for "A" elements, where this document applies names to the heading elements themselves.
Version: Kuma → unspecified
Component: Docs Platform → Editing
So we need to include "name" attributes' values in the list as possible destinations.
Summary: Kuma: Editor - link editor is not working when using anchors → Kuma: Editor - link editor can't find sections in the page for linking to them
Blocks: 1032827

There are still serious problems with editing links in the wiki right now. Nearly all on-page links we create are section links; that is, links to a specific section on the page, rather than links to an explicit anchor.

We need badly a "Link to a section on this page" mode which provides a list of all the sections on the page. The list should present the current content of each <h#> element (and possibly also the heading's ID), and should set the link's target to the selected element's ID. The current situation is incredibly frustrating when working to update links.

Aside
It might be worthwhile to add something like a data-target-title attribute to the link, which contains the link's current title. This would let us at some point in the future use code to look for cases where the destination ID doesn't exist, then look to see if the title exists and update the ID. If the title no longer exists, then we can present an error or notify someone that the link needs looking at.

See Also: → 1533602
MDN Web Docs' bug reporting has now moved to GitHub. From now on, please file content bugs at https://github.com/mdn/sprints/issues/ and platform bugs at https://github.com/mdn/kuma/issues/.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.