PDA

View Full Version : Spaces in posts - post formatting


AshMagic
09-28-2011, 12:57 PM
I have found a problem with Spaces when posting..

How can we make all text preserve multiple spaces (code and highlight tags currently do this)?

ex.:

1
21
321
4321
54321


1
21
321
4321
54321

Both texts are exactly the same (including spaces), but the first has all spaces removed while the second preserves them. The result is two outputs that look very different.

Any ideas on how to fix this? Thanks.

kh99
09-28-2011, 01:01 PM
I think you need the text to be inside <pre> ... </pre> tags to preserve spaces. There may also be a CSS way to do this, I'm not sure.

AshMagic
09-28-2011, 01:21 PM
1
21
321
4321
54321



1
21
321
4321
54321


I have tried noparse and pre tags. No luck.
It's a shame this can't be default.

kh99
09-28-2011, 01:34 PM
It's the way html works, not a problem with vb. All white space is combined into one space unless it's in a <pre> tag (and I mean the html tag, not a bbcode like [pre]). You could probably make it the default by editing the postbit template and putting the post message inside <pre> ... </pre> tags, but I'm not sure what the result would look like.

If you just want the ability to use bbcode to preserve spaces for certain text, you could define your own [pre] tag using <pre>{param}</pre> as the replacment.