Prevent empty URL input

Created on 27 October 2023, about 1 year ago

Problem/Motivation

We are upgrading from CKEditor 4 to 5 for a D10 upgrade due to D9 EOL. In CKEditor 4, you were not allowed to create a link without it having a valid URL/href. In CKEditor 5, you're allowed to input nothing for the URL and it will turn the selected text into an anchor with an href attribute set to nothing. E.g., <a href>Text</a>.

We allow content editors to apply button styles to anchors (<a>) and allowing empty anchors is a regression for our users. We'd like the option to be able to disable empty input and require a URL/href value.

Steps to reproduce

1. Edit an entity with a CKEditor
2. Type some text
3. Select the text and click the link button
4. Click the check box without inputting anything
5. Watch the text get wrapped with <a href></a>

Proposed resolution

Allow the ability for Drupal site owners to disable empty URL input.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Active

Version

6.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States joegl

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

Comments & Activities

Production build 0.71.5 2024