Allow adding ID without populating link

Created on 30 March 2017, about 7 years ago
Updated 25 March 2024, 3 months ago

Currently if you try to make a link by only populating the ID field (exposed via editor_advanced_link) and save the modal the id value will not get added to the selected text (confirmed by viewing source in CKEditor.

If this could be made to work it would allow for the use of linkit/editor_advanced_link to create anchor links.

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia realityloop

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

Comments & Activities

Not all content is available!

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

  • πŸ‡§πŸ‡ͺBelgium Wim Leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    This is not a core issue, but a restriction in editor_advanced_link. It's right in the original issue summary πŸ˜…

  • πŸ‡ΊπŸ‡ΈUnited States caspervoogt

    What @Wim_Leers said.

    Editor_advanced_link is stripping out my empty links, including anchor tags. Core does too (by default), but it can be worked around like I describe below. I manage a Drupal 10.2.2 + CKEditor5 site that has pages containing tons of anchor tags e.g:

    <a href="abc123"></a>

    Those get removed when saving the node with editor_advanced_link is active.
    With editor_advanced_link uninstalled, this also happens, but I can fix it by:

    A) Enabling the CKEditor5 Source plugin
    B) Adjusting that plugin's "Manually editable HTML tags" settings to include "".

    After that I can add/edit/save textless '' anchor tags without issue.

    I tested the above with Linkit uninstalled, so it is not in the mix here.

    With editor_advanced_link installed, my 'Source editing' CKEditor5 plugin settings for get overridden by editor_advanced_link and show "The following attribute(s) can optionally be supported by enabled plugins and should not be added to the Source Editing "Manually editable HTML tags" field: Advanced links ()."

    This happens even when I have not yet selected any of the attributes this module provides (aria-label, title, class, id, target, rel). As soon as I install this module, anchor tags / links with no text stop getting saved. I also tried enabling the 'Limit allowed HTML tags and correct faulty HTML' filter, which did not help.

Production build 0.69.0 2024