-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Text styles not kept when being converted #8921
Comments
This is an issue our customers are facing, so it is very urgent for us but we couldn't solve it on our end. If any workaround can be provided, we would really appreciate it! |
Hi! Could you please tell us what is your expected result? Do you expect to keep styles define in this span:
... and convert it to a single span or keep the structure of nested spans? |
@Mgsy Both would work for us, as long as the styles can be kept. In the above example, our customers were seeing black text, but it now becomes blue, which makes them vey confused (since they don't know the underlying HTML looks like). |
Hi @Mgsy , do you need more information on this one? I see the 'pending: feedback' label is still there. |
Hi @LangQian, I'm sorry for the late response, we had a busy period. I'll look at your case soon and get back to you. |
@LangQian, thanks for bringing it to our attention. There's an issue with our converters - in the case of nested elements, styles from the deepest one should be applied, while now, those are ignored. Note: CKEditor 4 handles such case properly and applies styles from the deepest nested element. |
A related issue in text part language feature - #9074 (comment), #9074 (comment) |
Fix (engine): While setting attributes upon upcast conversion, don't override attributes that were already set. The correct behavior is to keep the "information" applied by the deepest nodes in the view tree as, in most cases, the deepest node will have precedence (e.g. inline style applied by the deepest node). Closes #8921.
📝 Provide detailed reproduction steps (if any)
Load the following HTML into CK Editor
<span style="font-family:'helvetica';"> <span style="color:#0000ff;"> <span style="font-size:16px;font-family:'arial';color:#000000;"> aaa </span> </span> </span>
After CK Editor's processing, the above one was converted to the following one:
<span style="color:#0000ff">aaa </span>
✔️ Expected result
Styles should be kept after conversion.
❌ Actual result
Most styles were lost in the above scenario.
If you'd like to see this fixed sooner, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: