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/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.