Empty anchor links are not editable

Created on 2 October 2023, 9 months ago
Updated 30 November 2023, 7 months ago

Problem/Motivation

In the 2.x version of this module it was possible to create empty anchor links and edit them by double clicking them or by clicking them and clicking the anchor link button. This is not currently possible in the 3.0.x version. The only way to change empty anchor link names is by removing and recreating them. This is less user friendly than the old way.

Steps to reproduce

  1. Apply the appropriate configuration to be able to use this widget on a field (i.e. install the module, add the plugin to a text format)
  2. Edit a WYSIWYG field and click somewhere with no content (do not highlight existing content)
  3. Click the anchor link button
  4. Enter a name
  5. An empty anchor link will be created (here represented as [INVISIBLE ANCHOR LINK: ]
  6. Try to double click this anchor link or click it and click the anchor link button - nothing happens

Proposed resolution

There should be an easier way to edit the name of the anchor link. Ideally the same behaviour as before where double clicking it or clicking it and clicking the anchor link icon opens the dialog to set the name again.

Remaining tasks

This probably needs to be updated in the external plugin at https://github.com/northernco/ckeditor5-anchor-drupal. The external plugin is a fork of bvedad/ckeditor5-anchor and probably needs to first be updated in https://github.com/bvedad/ckeditor5-anchor/issues/6.

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇨🇦Canada Dylan Donkersgoed London, Ontario

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

Comments & Activities

  • Issue created by @Dylan Donkersgoed
  • 🇮🇳India vipul tulse

    Hello Team, Anyone has got chance to work on this.
    If any one has idea how we can accomplish this please guide here.

  • 🇦🇺Australia mstrelan

    The external plugin is a fork of bvedad/ckeditor5-anchor and probably needs to first be updated in https://github.com/bvedad/ckeditor5-anchor/issues/6

  • 🇮🇳India vipul tulse

    I have added few comments with code fix which we need to do in the code changes.

    Thanks for the great work.

  • Thanks for the work on this. Are we at the mercy of northernco to merge in your requests, or is there a way we can patch this to get empty anchors working? Thanks!

  • 🇦🇺Australia mstrelan

    Merging would be ideal, I've addressed or at least responded to all feedback. But you can clone the PR from my fork and build it yourself and use the dist file in your Drupal site.

  • 🇮🇳India vipul tulse

    @Dylan Donkersgoed can you make me maintainer for Drupal 10 branch so will add library inside module to instead of dependent other Git repo

  • Status changed to Fixed 7 months ago
  • 🇨🇦Canada Dylan Donkersgoed London, Ontario

    Thanks for the PR mstrelan and vipul-tulse for reviewing. The latest dev version requires a tag with this PR merged in.

    As for bringing this into Drupal I'm not sure bringing it into the module is the way to go. Despite the name of the repo, I don't think it's actually Drupal specific. It works inside the non-Drupal CKE5 sample environment at least.

    When I first started work on this I was attempting to adapt the existing plugin to work the way I'd seen other Drupal CKE5 plugins work. I did not realize what I was actually doing was adapting it to be a DLL plugin, which is a recognized method of building a CKE5 plugin that works even outside of Drupal. So I called it ckeditor5-anchor-drupal.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024