froala / react-froala-wysiwyg

React component for Froala WYSIWYG HTML Rich Text Editor.
https://froala.com/wysiwyg-editor
564 stars 129 forks source link

Changing the font-size creates invalid html #232

Open majesticuser opened 4 years ago

majesticuser commented 4 years ago

Affected versions:

Here is an example: https://codesandbox.io/s/react-froala-initialized-bug-ekw5j

Open the following link in a browser to produce the broken behaviour: https://ekw5j.codesandbox.io/

In the following image you see what you can enter to produce the broken html. browser

In the following image you see the console log output on changing the text in the editor. Here you can see, that the font-size has a line break, that is not correct markup. console

If you initialize the froala editor with the broken html it strips out the broken inline style and looses the font-size information.

The froala-editor Version 3.0.6 does not have this issue.

dejanmartinovic commented 4 years ago

You can try to remove @latest .css file from the HTML file and import css in js file like this: import "froala-editor/css/froala_editor.pkgd.min.css"; https://codesandbox.io/s/react-froala-initialized-bug-2p9ty

majesticuser commented 4 years ago

You can try to remove @latest .css file from the HTML file and import css in js file like this: import "froala-editor/css/froala_editor.pkgd.min.css"; https://codesandbox.io/s/react-froala-initialized-bug-2p9ty

@dejanmartinovic Thank you for your response :-) Your example is based on the froala 3.0.6 version. As described in the original issue, the bug was introduced in the froala 3.1.0 version. I've forked your codesandbox example:

https://codesandbox.io/s/react-froala-initialized-bug-udhgr

Your suggestions don't fix the broken html font-size problem.

dejanmartinovic commented 4 years ago

@majesticuser You were right. My apologies for that. This issue occurs in v3.1.0. I'm glad to inform you that development has already fixed this issue and the fix will be available in the next editor release. You can test it in this fiddle by changing the version to 3.1.0: https://jsfiddle.net/dejan_m/og0hxf2t/3670/

majesticuser commented 4 years ago

@majesticuser You were right. My apologies for that. This issue occurs in v3.1.0. I'm glad to inform you that development has already fixed this issue and the fix will be available in the next editor release. You can test it in this fiddle by changing the version to 3.1.0: https://jsfiddle.net/dejan_m/og0hxf2t/3670/

@dejanmartinovic Thanks, when will the 3.1.1 version be released?