18

Sometimes, when the username at the end of a comment wraps to a new line, the dash before it gets left dangling on the previous line:

Screenshot #1

In fact, even when the username doesn't wrap, it still looks kind of ugly: the space between the dash and the username is twice as wide as the space between the comment text and the dash, even though the dash is, logically, part of the user signature rather than the comment text:

Screenshot #2

Admittedly, it's a minor problem, but the cause is pretty obvious if you look at the HTML source:

Screenshot #3

See all that whitespace between the   and the username? That's where the linebreak appears, and that's also why the space after the dash looks twice as wide as usual (since the browser renders the   as one space, and the whitespace after it as another).

And, indeed, removing the extra space, like this:

Screenshot #4

...makes the dash wrap correctly:

Screenshot #5

So, here's one for you HTML guys (and girls) at SE: please fix this extra whitespace, and make our comments look less ugly!


Ps. While I'm at it, may I suggest that, when fixing this bug, another   should be added before the dash, making the HTML look like this:

<span class="comment-copy">...</span> &nbsp;–&nbsp;<a ... class="comment-user">...

Out of the variants I tested, this gives the nicest-looking output, both when the username wraps to a new line and when it doesn't.

5
  • I wouldn't call it a bug, but agree it doesn't look nice and can be improved. :) – Shadow The Vaccinated Wizard Nov 13 '14 at 13:16
  • @ShadowWizard: I'd call it a bug (specifically, a regression), because it's pretty clear that someone originally put that &nbsp; there for a purpose, and the purpose must've been to keep the dash from dangling like that. Most likely, someone else later edited the same code, didn't realize what the &nbsp; was there for, and added a line break after it to make the indentation nicer, thus breaking it. Sure, it's a minor bug, but when a deliberate feature stops working, that's still a bug. – Ilmari Karonen Nov 13 '14 at 13:22
  • Might be, let the team decide. (hopefully it won't sit and wait for years like most non critical bugs) – Shadow The Vaccinated Wizard Nov 13 '14 at 13:24
  • @cVplZ Well, then you might as well go all the way with O – Jason C Nov 14 '14 at 3:26
  • @cVplZ Then make it a 0. – user Nov 14 '14 at 15:05
3

This has been fixed and will appear in build 3762 for MSE/MSO, and build 2883 for other sites.

1
  • Unfortunately, it seems that the fix is not sufficient: Chrome at least is still happy to break lines between the &nbsp; and the user profile link, even though there's no space there. Apparently, stopping that requires wrapping both the dash and the link in an explicit <span style="white-space:nowrap">–&nbsp;<a href="...">...</a></span>. – Ilmari Karonen Mar 7 '19 at 19:40

You must log in to answer this question.

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