2 ms·
Definitely in agreement on this one. I have a writing app which uses HTML as it's native format, and I've received a number of complaints from people about how
by peterkelly 13y ago
Definitely in agreement on this one. I have a writing app which uses HTML as it's native format, and I've received a number of complaints from people about how it doesn't allow you to use multiple consecutive spaces. I suspect most of them are coming from a MS Word background (the app lets you edit Word documents but converts them temporarily to HTML for editing).
Usually I just explain that this is how HTML works; whitespace is collapsed, and so my app is inherently dependent upon the capabilities of HTML and the layout engine being used (in my case, WebKit).
However after the most recent complaint I finally spent some time looking deeper into the CSS spec and found out that you can set white-space: pre-wrap on a style, which will preserve consecutive spaces in the way that some people are accustomed to in Word. Now that I'm aware of this, I'll be turning this on by default for Word documents when I translate them to HTML, and for documents stored directly in HTML format I'll offer this as an option that can be set on a document-wide or style-specific basis.
I've always seen the one-space vs. two-space argument as a bit pointless, since this is something that is within the domain of what software can handle, for the most part. LaTeX has facilities for adding extra space after periods, for example. The main difficulty is distinguishing between abbreviations and words like e.g. which don't start a new sentence, so you don't want extra space after them. And I'm not aware if any web browser or HTML layout engines which add extra space like LaTeX (which I think is 1.5 times a normal space), but I cold be wrong.
As much as I've been in the camp of "just use one space; what's the big deal?" I think you've raised a very good point that the double-space can be treated as semantic information that instructs the typesetting system to place the surrounding characters further apart, even if it isn't exactly two spaces (and in the case of justified text, giving a greater weight to whitespace specified using two space characters).
TL;DR: white-space: pre-wrap is a handy feature of CSS