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

Picture "sources" downcast converter duplicates "picture" element when "sources" model attribute updated #17192

Open
f1ames opened this issue Oct 1, 2024 · 0 comments · May be fixed by #17193
Assignees
Labels
package:image squad:collaboration Issue to be handled by the Collaboration team. status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@f1ames
Copy link
Contributor

f1ames commented Oct 1, 2024

📝 Provide detailed reproduction steps (if any)

  1. Go to CKBox manual test (e.g. http://localhost:8125/ckeditor5-ckbox/tests/manual/ckbox.html).
  2. Insert any image from CKBox as a first editor element (it's important for image to have picture element).
  3. Run editor.model.change( writer => writer.setAttribute('sources', [ { srcset: './sample.png' } ], editor.model.document.getRoot().getChild(0)) );.
  4. Take a look on image element in CKE5 inspector in View tab.

✔️ Expected result

The view data has structure like figure > picture > sources + img.

❌ Actual result

The view data has structure like figure > picture > sources > picture > sources + img.

image

❓ Possible solution

The sources downcast converter does not check the structure of the updated element and always inserts new picture element. The good news is that on editor.getData() resulting HTML is correct without nested strucure.

📃 Other details

  • Browser: Chrome
  • OS: macOS
  • First affected CKEditor version: Not sure, tested on latest one (43.1.1).
  • Installed CKEditor plugins: See mentioned manual test.

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@f1ames f1ames added type:bug This issue reports a buggy (incorrect) behavior. package:image squad:collaboration Issue to be handled by the Collaboration team. labels Oct 1, 2024
@f1ames f1ames self-assigned this Oct 1, 2024
@CKEditorBot CKEditorBot added the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:image squad:collaboration Issue to be handled by the Collaboration team. status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants