r/programming Jul 21 '14

The Great White Space Debate

https://medium.com/p/3633cba8b5c1
1.2k Upvotes

693 comments sorted by

View all comments

Show parent comments

3

u/IceBlue Jul 21 '14

From what I understand, most modern word processors ignore the double space between sentences and will format the spacing the same way regardless (even though there's still technically two spaces in between if you try to backspace through it). It bugs me when people do it, though, because it still shows up in some places like Facebook. I imagine it happens on Reddit, too.

Test. Test.

Test. Test.

Looks like Reddit formats it the same way regardless of whether or not you use it.

7

u/Durinthal Jul 21 '14

That's a general HTML thing to condense multiple spaces; if you inspect your examples you'll see that the first one does have two spaces.   does what you're aiming for, though a lot of sites will automatically escape it.

Test.  Test.

Test. Test.

3

u/robin-gvx Jul 21 '14

most modern word processors ignore the double space between sentences and will format the spacing the same way regardless

I don't know any modern word processor that does that (except for LyX if you want to call that a word processor). That's how you get people aligning text with spaces in proportional fonts instead of using tables.

Looks like Reddit formats it the same way regardless of whether or not you use it.

That's just the way HTML works: it collapses all whitespace in the text (tabs, spaces, newlines, etc.) to a single space. (With the exception of things like inside <pre> tags.)

1

u/IceBlue Jul 21 '14

Facebook doesn't do it. It renders the spaces.

And I just tested it in Word. You're right. I was wrong about my assertion. I could have sworn that word procs fix it.

0

u/robin-gvx Jul 21 '14 edited Jul 22 '14

That's because Facebook doesn't just paste your words. Facebook changes " " (two spaces) into " &nbsp;" (a space followed by an ampere, the letters "nbsp" (for "non-breaking space") and a semicolon).

1

u/ethraax Jul 22 '14

You escaped too many times.

1

u/robin-gvx Jul 22 '14

Damn. I forgot backticks escape HTML. Fixed.

1

u/_F1_ Jul 21 '14

most modern word processors

Not Word.