ID:2591492
 
BYOND Version:513
Operating System:Windows 10 Pro 64-bit
Web Browser:Chrome 84.0.4147.89
Applies to:Dream Seeker
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:
Title

I need this because I feed text to my maptext, which auto adds it in a new line with the \n command. If the text that I'm feeding it has a center tag, it skips one extra line.

If this is intended behaviour please move this to Feature Requests and tell me if it's feasible.

Code Snippet (if applicable) to Reproduce Problem:
maptext="bla\n<center>ble</center>\nblo"


Expected Results:
bla
ble
blo


Actual Results:
bla

ble

blo


Does the problem occur:
Every time? Or how often? Y
In other games? Y
In other user accounts? Y
On other computers? Y

When does the problem NOT occur? Nva

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.) Unicode update

Workarounds: None that I know of

Your expected results are wrong.

This is our test HTML:

"bla<br><center>ble</center><br>blo"


This is our result in chrome, edge, firefox, and internet explorer:

bla
ble

blo


When we spoke earlier, I was incorrect that this was not a bug. In fact, BYOND's maptext linebreaks are too aggressive. Every other modern HTML renderer will not add the first line break provided there is no character on the current line after the line break.

However, your expectations are incorrect, and you could work around this simply by removing the unnecessary line breaks.

But yes, one of the two line feeds you are seeing is incorrect, but only one of them.
Yeah, the closing tag for a lot of block-type tags adds a linebreak to the end, I mean, it has to. You can't have two different justifications on the same line, afterall.
Bumpity
Bump. Also:
bla\n<span style='text-align: center;'>ble</span>\nblo

outputs
bla

ble
blo