suneditor
suneditor copied to clipboard
"Font color" always wraps text in an additional "span" tag.
Describe the bug "Font color" always adds a "span" tag even if the text is already wrapped in a "span" tag by previous operators. And it contains the style for "Font size". Because of this, other operators (for example strike or underline) do not behave correctly (have the wrong color)
To Reproduce Steps to reproduce the behavior:
- Type any word (for example "HELLO") -
<p>HELLO</p>
- Apply, for example, “bold” and set Font size = 36 -
<p><span style="font-size: 36px"><strong>HELLO</strong></span></p>
- Change Font color (for example #ff0000) -
<p><span style="font-size: 36px"><span style="color: rgb(255, 0, 0);"><strong>HELLO</ strong></span></span></p>
As you can see, an additional tag "span" has appeared - Due to the additional "span" tag, we get incorrect behavior from other tags.
For example, if you now try on strike (or underline), the line will be black and will not match the color selected as “Font color”
<p><span style="font-size: 36px"><del><span style="color: rgb(255, 0, 0);"><strong>HELLO</strong></span></ del></span></p>
But if you apply "Font color" first, and then "bold" and "Font size", then everything will be fine ("bold" and "Font size" do not add the tag)
<p><span style="color: rgb(255, 0, 0); font-size: 36px;"><del><strong>HELLO</strong></del></span></p>
Expected behavior "Font size" should not wrap the text in an additional "span" tag, but should use existing ones.
Screenshots
problem
correctly
Desktop (please complete the following information):
- OS: window 10 (64)
- Browser chrome
- Version 117.0.5938.134
Additional context A demonstration can be done and seen directly in your example: http://suneditor.com/sample/index.html
Thank you.