Add better support for linking to anchors

Created on 23 December 2018, over 5 years ago
Updated 7 June 2024, 19 days ago

It's technically possible to link to anchors in the following way:

  • If linking to an anchor on the same page, just use #anchor-name as the URL. LinkIt searcher will say that no content has been found matching that URL and it will be placed as is.
  • If linking to an anchor on some internal path that you just searched for, you can also manually append the #anchor-name to the end of the URL

The 2nd way is the problematic one. The problem is that when you append the fragment to the path, LinkIt will no longer return the data-entity-type and data-entity-uuid attribues for the <a&rt; tag that it inserts. This means that any substitution plugins (like one that converts an internal node path to the proper path alias) will no longer work.

I wonder if there's a way to improve this behavior so that fragments manually added to a URL do not interfere with the process.

Feature request
Status

RTBC

Version

7.0

Component

Code

Created by

🇺🇸United States bkosborne New Jersey, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024