Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Certain markup breaks the Source Editing mode #10703

Closed
maxbarnas opened this issue Oct 15, 2021 · 1 comment · Fixed by #11429
Closed

Certain markup breaks the Source Editing mode #10703

maxbarnas opened this issue Oct 15, 2021 · 1 comment · Fixed by #11429
Assignees
Labels
package:html-support squad:devops Issue to be handled by the Devops team. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@maxbarnas
Copy link
Contributor

maxbarnas commented Oct 15, 2021

📝 Provide detailed reproduction steps (if any)

  1. Go to https://ckeditor.com/docs/ckeditor5/latest/features/general-html-support.html#demo,
  2. In the Source Editing mode paste in the <dir><img contenteditable> into the editor,
  3. Switch back to a regular mode.

✔️ Expected result

Editor parses markup and shows the results.

❌ Actual result

An error is thrown in the console and the Source Editing mode is not allowing to change editor's content.

Uncaught TypeError: Cannot read properties of null (reading 'getAttribute')
    at setAttributeOnItem (writer.js:1489)
    at Writer.setAttribute (writer.js:380)
    at preserveElementAttributes (image.js:102)
    at UpcastDispatcher.dispatcher.on.priority (image.js:90)
    at UpcastDispatcher.fire (emittermixin.js:199)
    at UpcastDispatcher._convertItem (upcastdispatcher.js:249)
    at UpcastDispatcher._convertChildren (upcastdispatcher.js:282)
    at UpcastDispatcher.<anonymous> (upcasthelpers.js:783)
    at UpcastDispatcher.fire (emittermixin.js:199)
    at UpcastDispatcher._convertItem (upcastdispatcher.js:249)

❓ Possible solution

Initial check points to the image integration plugin in ckeditor5-html-support.

@maxbarnas maxbarnas added type:bug This issue reports a buggy (incorrect) behavior. squad:core Issue to be handled by the Core team. package:html-support labels Oct 15, 2021
@pomek pomek added squad:devops Issue to be handled by the Devops team. and removed squad:core Issue to be handled by the Core team. labels Feb 24, 2022
@CKEditorBot CKEditorBot added status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. and removed status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. labels Mar 4, 2022
@psmyrek
Copy link
Contributor

psmyrek commented Mar 8, 2022

The contenteditable is not needed. Any attribute in the img is enough to break the editor, i.e. <dir><img a>. Also <menu><img a> breaks the editor.

arkflpc added a commit that referenced this issue Mar 8, 2022
Fix (html-support): Skip inline image upcast conversion inside not supported element. Closes #10703.
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Mar 8, 2022
@CKEditorBot CKEditorBot added this to the iteration 52 milestone Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:html-support squad:devops Issue to be handled by the Devops team. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants