20

I entered a comment of the form Omit the `& ` entirely containing a segment in backticks. However, the space after the & inside the code segment was collapsed with the following space outside the code segment.

Enter image description here

This is due to a CSS rule for .comment-text code, which overrides the setting for white-space:

Enter image description here

Instead of overriding .comment-text code and setting white-space back to normal, the correct approach is to leave pre-wrap in place, and use word-wrap/overflow-wrap to allow breaking in the middle of something, since failing to wrap was the problem they were apparently trying to solve.

Also, I notice that hyphens (-) within code runs in comments are treated as a hyphenation opportunity, which seems wrong.

3
  • Live example: Omit the & entirely
    – Maroun
    Commented Dec 13, 2016 at 12:37
  • 1
    Just a quick test: code block with a linebreak. <-- The only reason I can think of for the white-space: normal;, but the linebreak is removed in the rendered output, any way.
    – Cerbrus
    Commented Dec 13, 2016 at 14:08
  • 4
    @Cerbrus I think that is the reason, actually: meta.stackoverflow.com/a/272194/390808 Commented Dec 15, 2016 at 14:17

0

You must log in to answer this question.