vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Spaces in posts - post formatting (https://vborg.vbsupport.ru/showthread.php?t=271048)

AshMagic 09-28-2011 11:57 AM

Spaces in posts - post formatting
 
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

Code:

    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 12: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 12:21 PM


1
21
321
4321
54321


[pre]
1
21
321
4321
54321
[/pre]

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

kh99 09-28-2011 12: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.


All times are GMT. The time now is 04:06 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01639 seconds
  • Memory Usage 1,709KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete