No announcement yet.

How to prevent CODE tag from adding inadvertant spaces between code?

  • Filter
  • Time
  • Show
Clear All
new posts

  • How to prevent CODE tag from adding inadvertant spaces between code?

    I'm sure this has been discussed already, though I was wondering, how do I "fix" the CODE tag of vBulletin so it doesn't add inadvertant spaces inside long code? For example:

    javascript:document.getElementById('myiframe').src =''
    As you can see, there's a long space between "src" and "=". Often times the code tag will render the containing code useless as a result.

    Thanks for any suggestions.
    - JavaScript Kit | CSS Drive | |

  • #2
    Admin Control Panel > vBulletin Options > vBulletin Options > Thread Display Options (showthread) >

    Number of Characters Before Wrapping Text (default is 80)

    This is useful in preventing long words from stretching your forum layout.

    Remember that, unless you are using preformatted text, X number of characters does not equal a specific width because different characters are different widths.

    If you want posts to automatically insert spaces into long words to make them wrap after a certain number of characters, set the number of characters in the box above.

    If you do not want this to occur, enter 0.


    • #3
      So for coding oriented forums, would you simply suggest setting this value to 0? Not sure what a good number would be if I wanted "the best of both worlds."

      Thanks much,
      - JavaScript Kit | CSS Drive | |


      • #4
        I wouldn't know the average amount of characters used for programming something. Try doubling it from 80 to 160 and see if that helps in the majority of the situations where this might happen.


        • #5
          Thanks Floris. Giving that a try.
          - JavaScript Kit | CSS Drive | |


          • #6
            It also happend to me in this post:

            It doesn't show the additional spaces in the while loop on the edit page. Are you sure word wrap is causing this?


            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.