ID:1701626
 
Resolved
The output control did not preserve whitespace when not inside a <pre> block or a similar style.
BYOND Version:507
Operating System:Windows 7 Home Premium 64-bit
Web Browser:Chrome 38.0.2125.104
Applies to:Webclient
Status: Resolved (507.1263)

This issue has been resolved.
Descriptive Problem Summary:
The webclient seems to clear out extra whitespace i use for text formatting unlike the BYOND client.

Webclient: http://puu.sh/chh4d/43fa57aa94.png
BYOND client: http://puu.sh/chhdv/bf3e5d9700.png
Numbered Steps to Reproduce Problem:

Code Snippet (if applicable) to Reproduce Problem:


Expected Results:

Actual Results:

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

When does the problem NOT occur?

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.)

Workarounds:

Do you have an example of the text you're outputting?

Multiple spaces should be surviving the sanitization process, so the only difference should be the browser's behavior in displaying the spaces. It probably makes sense to have the output control use white-space: pre-wrap by default so that whitespace isn't collapsed per normal browser behavior.
    format_text(text){
var/loc0 = findtextEx(text, "<a")
while(loc0){
var
loc1 = findtextEx(text, "</a>", loc0+1)
locend = findtextEx(text, ">", loc0+1)
Align = ckey(copytext(text,loc0+2,loc0+3))
width = text2num(copytext(text,loc0+3,locend))
align = LEFT

switch(Align){
if("l") align = LEFT
if("c") align = CENTER
if("r") align = RIGHT
}
var/altext = align_text(copytext(text,locend+1, loc1),width,align)
text = copytext(text,1,loc0) + altext + copytext(text, loc1+4)
loc0 = findtextEx(text, "<a")
}
return text;
}

align_text(text, width, align){
if(length(text) "> width){
text = copytext(text,1,width)
}
if(length(text) < width){
switch(align){
if(RIGHT){
for(var/i = 1 to width - length(text)) text = " "+text
}
if(LEFT){
for(var/i = 1 to width - length(text)) text += " "
}
if(CENTER){
for(var/i = 1 to round((width - length(text))/2)) text = " "+text+" "
for(var/i = 1 to width - length(text)) text += " "
}
}
}
return text;
}


it's just adding spaces.
Lummox JR resolved issue with message:
The output control did not preserve whitespace when not inside a <pre> block or a similar style.