ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
9.36k stars 3.68k forks source link

Italic style is invisible after applying it to the text pasted from Google #12518

Open Mgsy opened 1 year ago

Mgsy commented 1 year ago

πŸ“ Provide detailed reproduction steps (if any)

βœ”οΈ Expected result

The italic style is visible.

❌ Actual result

The italic style is invisible.

πŸ“ƒ Other details

It seems that it's caused by the fact that the copied text has font-style:none inline style and CKEditor 5 wraps <span> in <i>, so the inline style has a higher priority. In CKEditor 4 this issue doesn't occur, because italic is applied directly on text, not <span>, so it becomes <span><em>text</em></span>, instead of <i><span>text</span></i>.


If you'd like to see this fixed sooner, add a πŸ‘ reaction to this post.

Reinmar commented 1 year ago

Out of curiosity: What does CKE4 do in this case (with ACF disabled)?

Mgsy commented 1 year ago

Out of curiosity: What does CKE4 do in this case (with ACF disabled)?

I've mentioned it in the Other details section :smile:

In CKEditor 4 this issue doesn't occur, because italic is applied directly on text, not <span>, so it becomes <span><em>text</em></span>, instead of <i><span>text</span></i>.

Reinmar commented 1 year ago

I've mentioned it in the Other details sectionΒ 

:facepalm: Sorry :(Β 

Crazy idea: Maybe elements handled by GHS should get a different priority than default attribute elements? I wonder if it won't cause more issues (change the order when the current one is better) than help, but maybe it's worth considering.