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

editor.insertHtml pollutes editable with empty spans #2813

Closed
engineering-this opened this issue Feb 15, 2019 · 1 comment · Fixed by #2987
Closed

editor.insertHtml pollutes editable with empty spans #2813

engineering-this opened this issue Feb 15, 2019 · 1 comment · Fixed by #2987
Labels
status:confirmed An issue confirmed by the development team. support:2 An issue reported by a commercially licensed client. type:bug A bug.
Milestone

Comments

@engineering-this
Copy link
Contributor

engineering-this commented Feb 15, 2019

Type of report

Bug

Provide detailed reproduction steps (if any)

  1. Open https://codepen.io/anon/pen/QYZZOG
  2. Create selection in editor as following: Foo {Bar}.
  3. Press button insert below editor.

Expected result

Selected part is removed. And there is no empty element left.

Actual result

Empty span is left behind editor which is visible by red border.

Other details

These empty elements can't be focused (checked Chrome, Safari, Firefox), and they are removed on getData. They should be removed right away on insertHtml, because when styled they might be visible in editor.

https://github.com/ckeditor/ckeditor-dev/blob/002ec74de01c50d48e1ba2101785126a56407eeb/core/editable.js#L1719-L1723
☝️ This is where they ale splitted upon insertions, and when splitting leaves empty elements it's best place to clean them up.

@engineering-this engineering-this added type:bug A bug. status:confirmed An issue confirmed by the development team. labels Feb 15, 2019
@jswiderski
Copy link
Contributor

This issue was originally reported by Oracle and can be observed when pseudo elements are used: https://codepen.io/j_swiderski/pen/mvzvMZ.

@lslowikowska lslowikowska added the support:3 An issue reported by a commercially licensed client. label Feb 15, 2019
@engineering-this engineering-this changed the title editor.insertHtml pollutes editor with empty spans editor.insertHtml pollutes editable with empty spans Mar 26, 2019
@engineering-this engineering-this changed the title editor.insertHtml pollutes editable with empty spans editor.insertHtml pollutes editable with empty spans Mar 27, 2019
@lslowikowska lslowikowska added support:2 An issue reported by a commercially licensed client. and removed support:3 An issue reported by a commercially licensed client. labels Apr 15, 2019
@f1ames f1ames modified the milestones: 4.11.5, 4.12.0 May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:confirmed An issue confirmed by the development team. support:2 An issue reported by a commercially licensed client. type:bug A bug.
Projects
None yet
4 participants