Future fix Froala: Copying to text editor duplicates line-breaks

Affected version
2.0.7

Steffen

Well-known member
XenForo uses Froala's default Enter option $.FroalaEditor.ENTER_P (https://www.froala.com/wysiwyg-editor/examples/enter, https://www.froala.com/wysiwyg-editor/docs/options#enter) but sets the margin of "p" elements to 0.

Therefore, when copying text from XenForo's Froala to a text editor (Notepad, Sublime Text, ...), all line-breaks are duplicated. I guess that's because the text editor sees the "p" elements and thinks that for an appropriate representation of paragraphs as plaintext it should separate them with two line-breaks instead of a single line-break (because usually "p" elements have a margin, only XenForo sets the margin to 0 to "emulate" $.FroalaEditor.ENTER_BR).

So if you copy & paste the following lines from XenForo's Froala editor to a text editor application:

Line 1
Line 2
Line 3

This is the result:

Screenshot from 2018-06-05 16-18-18.png

Maybe $.FroalaEditor.ENTER_BR would be more appropriate for XenForo?
 
Last edited:

Mike

XenForo developer
Staff member
Not necessarily wrong, but also potentially a large change to make, so if we were to change this, it would likely be an indeterminate point in the future.
 
Top