11

Seems the problem is localized to WebKit

Anybody else notice this?

All code snippets, not just a particular post;

YSOD Yellow Screen Of Death JavaScript RegExp - Syntax Error

Pass array to client side for display

are just a couple..

12
  • link to a post that is showing the issue?
    – jjnguy
    Mar 20, 2010 at 16:21
  • And a better description of the problem... What exactly am I looking for?
    – tvanfosson
    Mar 20, 2010 at 16:25
  • 3
    +1, can reproduce. Chrome v4.1, Win7
    – jjnguy
    Mar 20, 2010 at 16:34
  • 3
    Reproduced on Chrome 4.1, Vista
    – user27414
    Mar 20, 2010 at 17:18
  • 2
    Reproduced - Chrome 4.1.249.1036 (41514) Win 7 x64 Mar 20, 2010 at 21:02
  • Reproduced: Chromium 4.0.226.0 (Ubuntu build 30050) and Chrome 5.0.307.11 beta (Ubuntu). I checked if it has something to do with the recently changed fontstack - I'm glad it has not. Mar 20, 2010 at 23:05
  • I was thinking if the way Chrom(e|ium) and Safari do it is really that bad. From my experiments with Chromium it seems that Copy & Paste still works properly, evern if the browser breaks the lines. Maybe the way Safari/Chrome display the code blocks is even superior? What do you think? Mar 21, 2010 at 9:31
  • 1
    @Ludwig - I think it is not acceptable. Code examples are rendered unreadable. Mar 21, 2010 at 19:14
  • It's not localized to Google Chrome because it affects all Webkit browsers. Mar 21, 2010 at 22:57
  • @Ludwid - right you are. Mar 21, 2010 at 23:01
  • What's the status on this? It seems to be something that recently changed on Stackoverflow that triggered this. Is anyone working on it? It's a real pain.
    – TechZen
    Mar 23, 2010 at 21:53
  • I just noticed this recently. This should be dealt with soon as it makes reading the code more difficult. Mar 26, 2010 at 3:17

7 Answers 7

2

I made the word-wrap: break-word; style apply to the child <p> element of .post-text rather than the whole thing.

1
  • 1
    admit it, you did it for the check and the rep. ;-p Thanks. Mar 26, 2010 at 4:45
4

I think word-wrap:break-word; in the .post-text class in http://sstatic.net/mso/all.css?v=6534 is to blame.

  .post-text{
    width:660px;
    font-size:107%;
    margin-bottom:5px;
    margin-right:5px;
    line-height:130%;
    word-wrap:break-word;
  }
  .post-text hr{
    background-color:#ddd;
    color:#ddd;
  }
  .post-text a{
    color:#000;
    border-bottom:1px #000 dotted;
  }
  .post-text a:hover{
    color:#6C0000;
    border-bottom:1px #6C0000 dotted;
    text-decoration:none;
  }
  .post-text img{
    max-width:640px;
  }

I think the word-wrap:break-word; is not what we want there. Was it added recently?

WORKAROUND FOR CHROME:

  • Add the stylish extension to Chrome
  • Add a style with the following Code

    .post-text{word-wrap: normal; !important;}

Enable your new style.

And the scrollbars are back:-)

6
  • @Gnome: Yes, add the link above. Mar 21, 2010 at 0:16
  • 1
    @Jeff: I agree for the comments, but what is your opinion on the code blocks? It seems that people would like to have their scroll bars back and if someone tries to break the layout deliberately you can't do much about it anyway. Mar 21, 2010 at 9:28
  • @Jeff: Maybe it is possible to set the word-wrap: normal; only for the codeblocks. (I have no time to check that right now.) Mar 21, 2010 at 9:34
  • @Ludwig - I gave the Stylish fix a try, not working for me ;-( What platform are you on? Mar 22, 2010 at 2:45
  • @Sky Sanders: Ubuntu 9.10, but that shouldn't matter. Make sure you have your new style enabled (I added another screenshot above). You can also try to leave the "Applies to" fields empty. Mar 22, 2010 at 4:44
2

Re: Jeff Atwood

Post Overflow

Well and good, but can we add word-wrap to the pre tags too? The following fixes the issue.

pre {
    font-family:Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,serif;
    margin-bottom:10px;
    overflow:auto;
    width:auto;
    padding:5px;
    background-color:#eee;
    width:650px!ie7;
    padding-bottom:20px!ie7;
    max-height:600px;

    word-wrap:normal;
}
2

Here is what it looks like in Chrome 5.0.335.0 dev on Ubuntu 9.04. (Updated to 5.0.356.2 dev with no change.)

screenshot of line wrapping

Since I hadn't updated Chrome in at least a few days (lazy, you know), I am fairly sure I have seen horizontal scrolling instead of wrapping with 5.0.335.0.

2
  • Yup. definitely call is broken. The code block rendered on every other browser scrolls, which requires an explicit css rule implying intent. Wrapping == broken. Thanks for the feedback r.e. chrome 5 - hasn't been pushed to windows yet. Mar 20, 2010 at 21:00
  • Seeing it here on 4.1.249.1036 on win7 Mar 20, 2010 at 23:40
0

Not sure if it is related but suddenly today I am getting similar text wrapping in code blocks. I came to Meta to check if anyone else had seen the problem.

I'm using Fluid Version 0.9.6. Fluid is a site specific browser generator based on Webkit/Safari. Ie used it to generate a SSB for StackOverflow and I have been using the resulting SSB for months now without issue. I am posting mostly Objective-C code.

I've been posting just as I always have i.e. same formatting, same text editor etc but today suddenly I can't get code to format. It wan't to wrap the code like blockquoted text.

For an example, see this post: iPhone: How to Embed NSData in XML for Upload to Server?.

I gave up trying to post code in a couple of other post.

I'll do some checking with all my browsers to see if its general.

1
0

This seems to be a webkit related bug.

0

Code block display on the iPhone has also suddenly changed... Anyone else seeing this?

There hasn't been any software update to cause this, so is it an intentional change?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .