Pasted text which contain bbcode loses line break

AndyB

Well-known member
Affected version
2.2.7
This new version of XenForo 2.2.7 has a bug regarding pasting text which contains bbcode.

For example I can copy the following text:

1631646248006.png

Then when I paste into the editor I see this:

1631646306399.png

Notice how the line break is not preserved.
 

AndyB

Well-known member
Hi Chris,

Also please note that pasted text which has a single empty line will get an additional empty line if the editor is in BB code mode. So for example when pasting:

line 1

line 2

will result in

line 1


line 2
 

Jeremy P

XenForo developer
Staff member
Thanks. I'm still not able to reproduce it on my end (copying rich text from your resources into the editor), but perhaps it only occurs on MacOS.
 

BassMan

Well-known member
This new version of XenForo 2.2.7 has a bug regarding pasting text which contains bbcode.

For example I can copy the following text:

View attachment 257277

Then when I paste into the editor I see this:

View attachment 257278

Notice how the line break is not preserved.
I can reproduce this too but in Safari and Firefox. The line is gone after pasting.

But if I copy it in Safari and paste it to Firefox then the formatting is preserved.



Hi Chris,

Also please note that pasted text which has a single empty line will get an additional empty line if the editor is in BB code mode. So for example when pasting:

line 1

line 2

will result in

line 1


line 2
If I paste this:

line 1

line 2


---------
... in Firefox I get this:

line 1
line 2

---------
Copying from Safari and pasting to Firefox, the formatting is preserved again.


Using macOS.
 

AndyB

Well-known member
Thanks. I'm still not able to reproduce it on my end (copying rich text from your resources into the editor), but perhaps it only occurs on MacOS.
Yes likely a macOS/Firefox bug. Please note the bug thread title indicates in has to do with bbcode, but it does not. I can also just copy three lines which have a line feed and the line feed is lost upon pasting.

I attached an example.mp4 for you to see ny exact steps.
 

Attachments

  • example.mp4
    9.1 MB

0815

Well-known member
Yes likely a macOS/Firefox bug.
I cannot say whether it is a bug on the part of FF. I can only confirm that this is also the case under Windows with FF. Texts copied from Chrome, vivaldi and opera are correctly inserted into the editor.

If I copy the text into Notepad++, the formatting is correct.
 

Rasmus Vind

Well-known member
A member of mine has shared a video of this same problem:

Copy-pasting from VS Code removes line breaks. Copy-pasting from Notepad++ does not. As you said.
 
Top