Problem/Motivation

Ckeditor moves span around by itself.

Steps to reproduce

Pasting this inside the source code view and switching back to wysiwyg mode.
<span class="ctr-box"><a class="ctr-button" href="https://www.drupal.org" rel="noopener nofollow" target="_blank">FOO</a></span>

Will result in :

<p>
    <a class="ctr-button" href="https://www.drupal.org" target="_blank" rel="noopener nofollow"><span class="ctr-box">FOO</span></a>
</p>

The span tag is moved inside the a tag. Kills the styling and logic of many of my templates.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

marcoka created an issue. See original summary.

cilefen’s picture

Does this happen on the demos? https://ckeditor.com/

wim leers’s picture

Title: Ckeditor moves <span> inside <a> tag » CKEditor 5 moves <span> inside <a> tag
Status: Active » Postponed (maintainer needs more info)

Thanks, @cilefen!

Related question: did you search https://github.com/ckeditor/ckeditor5 for a relevant upstream issue?

wim leers’s picture

marcoka’s picture

Thank you for the Info.
It can be reproduced with this page: https://ckeditor.com/docs/ckeditor5/latest/features/html/general-html-su...
Problem is that this "feature" kills content, data loss.
Can´t find any issues but the linked issue links an issue that is very similar.

dokumori’s picture

Title: CKEditor 5 moves <span> inside <a> tag » [upstream] CKEditor 5 moves <span> inside <a> tag
Category: Support request » Bug report
Issue tags: +Needs upstream bugfix

I ran into the same issue. Although the wording is different, I opened an issue in their issue queue:: https://github.com/ckeditor/ckeditor5/issues/15408

I was able to reproduce the issue on their demo page so it has to do with CKEditor5, not Durpal. Maybe this ticket can be closed (won't fix), but I'll let the maintainers decide.

wim leers’s picture

Version: 10.1.x-dev » 11.x-dev
Status: Postponed (maintainer needs more info) » Postponed
Issue tags: +Needs tests

Thanks @dokumori!

Ideally, we would add a test that detects when this is either fixed or when this regresses.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.