• Code should NOT auto wrap (word wrap)


  • It's not wrapping? In addition you can click on the small icon in the upper right corner of the code box, the overlay contains the raw code (in case your have trouble copying everything).


    Google Chrome
    Version 35.0.1916.153

    Ubuntu 14.04 LTS

    It appears wrapped, which is not good.

  • The wrapping is performed by the browser due to the lack of available width. Do you see these gaps between the line numbers? Just copy and paste the code somewhere (e.g. an editor) and the original view is restored, because there are no breaks inserted, it's just visually appearing like it does.

    If this doesn't please you, this tiny CSS snippet will turn overflow on, resulting in the display of scroll bars (if required):

    CSS
    .codeBox {
    	overflow: auto;
    
    	> div > ol > li {
    		white-space: pre;
    		word-wrap: normal;
    	}
    }
  • The wrapping is performed by the browser due to the lack of available width. Do you see these gaps between the line numbers? Just copy and paste the code somewhere (e.g. an editor) and the original view is restored, because there are no breaks inserted, it's just visually appearing like it does.

    If this doesn't please you, this tiny CSS snippet will turn overflow on, resulting in the display of scroll bars (if required):

    CSS
    .codeBox {
    	overflow: auto;
    
    	> div > ol > li {
    		white-space: pre;
    		word-wrap: normal;
    	}
    }

    I would ask this to be default in 4.1 as it is exactly how other developments do it... By other, I mean all.... phpBB, SMF, IP.Board, vBulletin, XenForo, FluxBB, ect.. ect...

    [Blocked Image: http://www.webpagescreenshot.info/i3/53aee8f59d90c9-31150193]
    Taken with Webpage Screenshot

    Pasting it into a 3rd party editor will not solve the problem either, because the editor would keep the layout of whatever was copied from WBB. The point is to make the code usable for anyone who finds it posted on a WBB type community ;)

  • Pasting it into a 3rd party editor will not solve the problem either, because the editor would keep the layout of whatever was copied from WBB.


    Actually, it doesn't.
    If you copy-paste the code it will be exactly as it was at the time of writing. The word-wrap is performed by your browser, if you copy&paste there won't be any additional newlines be inserted.


    I agree that the default style isn't necessarily the best and that - at least for code - scrollbars can be benefitial. But on the other hand, those scroll bars are really annoying on mobile phones, where wrapping is definitely the better option.

    "A life is like a garden. Perfect moments can be had, but not preserved, except in memory. LLAP" — Leonard Nimoy

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!