Problem after updating CKEditor 5 Plugin Pack 1.4.2 > 1.5.0

When using the Link Attributes feature from CKEditor 5 Plugin Pack, adding a rel attribute via the UI does not work correctly.

Specifically, when entering:

rel|nofollow

the resulting HTML output contains:

<a href="..." rel="o">...</a>

instead of the expected:

<a href="..." rel="nofollow">...</a>

This issue only affects the rel attribute.
Other attributes such as class|button work correctly and produce valid output.

Environment

- Drupal core: 10.6.2
- CKEditor 5 Plugin Pack: 1.5.0
- CKEditor 5 Link Attributes: enabled (from Plugin Pack)
- Text format: Full HTML
- PHP: 8.3

Steps to reproduce

1. Enable CKEditor 5 Plugin Pack (1.5.0).
2. Enable Link Attributes.
3. Go to Configuration → Content → Text formats and editors → Full HTML.
4. Ensure CKEditor 5 is enabled and Link Attributes button is available.
5. Create or edit content using Full HTML.
6. Insert a link.
7. Open Link Attributes dialog.
8. Add the attribute:

rel|nofollow

9. Save the content.
10. Inspect the rendered HTML.

Actual result

The link is rendered as:

<a href="..." rel="o">...</a>

Expected result

The link should be rendered as:

<a href="..." rel="nofollow">...</a>

Additional notes

- The issue only affects the rel attribute.
- Other attributes work correctly, for example:
class|button → class="button"
- Downgrading CKEditor 5 Plugin Pack to 1.4.2 fix the problem.
- The issue appears to be related to how the Link Attributes plugin parses the rel attribute value.

CommentFileSizeAuthor
#10 patch-after.png20.53 KBjannakha
#10 patch-before.png28.81 KBjannakha
#10 enabled.png179.79 KBjannakha
scr1.jpg124.51 KBwamwam
scr2.jpg50.19 KBwamwam
scr3.jpg51.68 KBwamwam
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

wamwam created an issue. See original summary.

wamwam’s picture

Issue summary: View changes
wamwam’s picture

Issue summary: View changes
wamwam’s picture

Issue summary: View changes
wamwam’s picture

Issue summary: View changes
wamwam’s picture

Issue summary: View changes

salmonek made their first commit to this issue’s fork.

salmonek’s picture

Status: Active » Needs review

Hi wamwam
Thank you for reporting the issue and detailed description. The bug was indeed introduced in 1.5.0
It affected all attributes except class and id. I've pushed a MR with patch that fixes the issue.

jannakha’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new179.79 KB
new28.81 KB
new20.53 KB

Patch applied, tested, bug fixed!

Modules:
modules

Before:
Before patch

After:
after patch

salmonek’s picture

Status: Reviewed & tested by the community » Fixed

Fix released in 1.5.1

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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