• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Pasting code into a post deletes all blank lines

Level 20
Joined
Jul 10, 2009
Messages
477
Hey @Ralle,

I had a hard time publishing a code submission in the Lua sub-forum today, because pasting code into a post would remove all blank lines from it.
Of course, the code was intentionally formatted this way, so I had to manually re-add blank lines after pasting, which was very tedious (long code).
Would it be an option to retain those pesky line-breaks upon pasting text? :D

Also, pasting anything into a numbered list will immediately create a linebreak and a new numbered bullet, even when the pasted text doesn't contain any linebreaks.
That was also kind of annoying for me personally, as it takes time to clean up the chaos that came from pasting.

Other than that, thank you for all the great work you conduct on the site. :)

Best regards,
Eikonium
 
Level 20
Joined
Jul 10, 2009
Messages
477
32-bit Firefox

I've just conducted a few more tests and saw that it also happens with Google Chrome.
The issue rather seems to be the source of the text.

Blank lines get eaten, if I paste code from VS Code to Hive, but stay if I paste from Notepad to Hive.

They also stay from VS Code -> Notepad, so I can paste VsCode -> Notepad -> Hive to bring them here.

At least I have a workaround now, so if you don't want to bother with this anymore, that's fine :)
 
Level 20
Joined
Jul 10, 2009
Messages
477
Sure thing, attached.

It shows in order:
1. that pasting multi-line text from VS Code to Hive removes blank lines
2. that pasting multi-line text from VS Code to Notepad++ and Notepad++ to Hive does not remove blank lines
3. that pasting single-line text from VS Code to Hive adds a line break and sometimes even a new bullet in a numbered list

Edit: Fyi, I just noticed that the reverse of the bug is also true: Pasting text from Hive (i.e. from the textbox where you write a reply) to VSCode adds a blank line after each linebreak :D
 

Attachments

  • Replay_2022-01-26_03-16-56.zip
    4.7 MB · Views: 10
Last edited:

Ralle

Owner
Level 77
Joined
Oct 6, 2004
Messages
10,098
Thanks for sharing the video. I have posted about it here:
 
Level 20
Joined
Jul 10, 2009
Messages
477
Yes, exactly.
To be clear:
  1. I copy a bunch of text containing empty lines within VS Code. I go into my browser, open XenForo testpage, create a new thread, paste stuff into XenForo editor. Empty lines go away. Basically, XenForo converts every two consecutive line breaks into one, which destroys empty lines.
  2. Other way around, I write text into the XenForo editor that contains line breaks here and there. I mark and copy, go into VSCode, open an empty document, paste it. A linebreak is added to every block of linebreaks, effectively adding an empty line everywhere (i.e. 1 linebreak gets 2 linebreaks, 2 linebreaks gets 3 linebreaks and so fourth).
Problem 1 does not hold for Notepad++ -> XenForo (line breaks stay the same, so I can work around the issue by going VS Code -> Notepad++ -> XenForo).
Problem 2 in fact also holds for XenForo -> Notepad++ (added line break).
 

Ralle

Owner
Level 77
Joined
Oct 6, 2004
Messages
10,098
Thanks for the clarification. I have posted about it here:
 
Top