19

Due to the code in the comment to question Laravel install Agent with composer, the contents overflows the comment box. Removing white-space: pre-wrap fixes the problem.

screenshot of problem.

This was found in Firefox 31.0 on Arch Linux, and persists with Firefox 32.

10
  • 3
    How did they even do that? [Composer\Downloader\TransportException] The "https://getcomposer.org/version" file could not be downloaded: php_network_getaddresses: getaddrinfo failed: Name or service not known failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known.
    – Lekensteyn
    Commented Aug 26, 2014 at 18:39
  • 2
    Lots and lots of space characters, apparently. Removing them fixes the formatting for me on Firefox. Definitely looks like a bug, yup, although it might be a client-side one. Commented Aug 26, 2014 at 18:43
  • 9
    Confirmed that spaces are causing an overflow in Firefox 31. Could not reproduce on Chromium 36 by the way.
    – Lekensteyn
    Commented Aug 26, 2014 at 18:45
  • 2
    @Lekensteyn Don't worry, IE11 overflowed as well.
    – Kendra
    Commented Aug 26, 2014 at 18:48
  • 14
    @Kendra, that's because IE11 wants to be Firefox with all its heart. They should have thought that would backfire in some way. Commented Aug 26, 2014 at 18:48
  • 1
    "Removing white-space: pre-wrap fixes the problem" - allowing users with enough rep to migrate the information back into the question would fix it too. Instead, folks have to get a moderator involved.
    – jww
    Commented Aug 27, 2014 at 17:30
  • I got the same result with Firefox 31.0 on Windows. Commented Aug 27, 2014 at 18:31
  • 1
    Found similar comments, but without any code formatting, as far as I can see, at least in Firefox 31.0. Check this: stackoverflow.com/a/7162814/806975 Commented Sep 12, 2014 at 17:51
  • @GuillermoGutiérrez Confirmed with Firefox 32.0.
    – Lekensteyn
    Commented Sep 12, 2014 at 21:11

1 Answer 1

4

Thanks for bringing this up. I've modified the CSS for .comment-text code blocks to set white-space: normal which is honored due to CSS specificity. As a result, code blocks in comments should not overflow any longer. Note that this only affects code blocks in comments, not in questions or answers. This will be live after the next prod release (meta: > rev 2014.9.25.2605, q&a: > rev 2014.9.25.1892).

6
  • Great, I'll wait for the next build. How often does SE roll out?
    – Lekensteyn
    Commented Sep 25, 2014 at 21:18
  • 2
    1-10x a day or so. It'll surely be within the next 24 hours.
    – Haney Staff
    Commented Sep 25, 2014 at 21:42
  • 8
    This causes multiple spaces to be collapsed into a single one, for example / / appears to only contain one space. This caused some confusion in this comment!
    – Tom Fenech
    Commented Sep 15, 2015 at 12:59
  • This seems to be causing more troubles: meta.stackoverflow.com/questions/339485/… Commented Dec 15, 2016 at 15:57
  • This fix was wrong. Instead of overriding .comment-text code and setting white-space back to normal, you should have left pre-wrap in place, and use word-wrap/overflow-wrap to allow breaking in the middle of something.
    – user663031
    Commented Dec 15, 2016 at 20:19
  • Happening again: Comment code format overflow covered by job
    – ppwater
    Commented Nov 29, 2020 at 14:07

You must log in to answer this question.

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