Fixed 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.webp

Then when I paste into the editor I see this:

1631646306399.webp

Notice how the line break is not 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
 
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.
 
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.
 
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

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.
 
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.
 
A member of HIVE reported it a few weeks back and we are on the latest version already. I can try to get someone to help me reproduce it on this site.
 
The video in the post you linked above shows a XenForo copyright date of 2021 which means the video was made using a very old version.

It would be good to know if it's still reproducible now, and over here in the Test messages forum if they're willing to create an account.

This bug report is now closed though (while similar, it's a different issue) so if it is reproducible please create a separate, new bug report. It's difficult to track everything when people tack additional issues onto existing bug reports.
 
I have been in touch with the community member and here is his latest update (hint there is still a problem):

Basically, copy-pasting code reduces any number of consecutive line breaks into a single line break thus eliminating empty lines.
 
I have the opposite problem now.
I want to add text between two bbcodes without haveing a line break after and before the two bbCodes;
if you do a frame for example it is different if it looks like:

____________
| Texz


or

____________
|
| Texz
 
Back
Top Bottom