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.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | patch-after.png | 20.53 KB | jannakha |
| #10 | patch-before.png | 28.81 KB | jannakha |
| #10 | enabled.png | 179.79 KB | jannakha |
| scr1.jpg | 124.51 KB | wamwam | |
| scr2.jpg | 50.19 KB | wamwam |
Issue fork ckeditor5_plugin_pack-3566904
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
Comment #2
wamwam commentedComment #3
wamwam commentedComment #4
wamwam commentedComment #5
wamwam commentedComment #6
wamwam commentedComment #9
salmonek commentedHi 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.
Comment #10
jannakha commentedPatch applied, tested, bug fixed!
Modules:

Before:

After:

Comment #11
salmonek commentedFix released in 1.5.1