Hacker News new | ask | show | jobs
by WovenTales 2981 days ago
Seems good so far, but it's annoying that the author needlessly sniped at double-spaced sentences. He even admits that whitespace collapsing makes it a meaningless distinction, but rather than focus on the actual information of "if you really need them, here's the vaious Unicode spaces" he spends over half the section harping on something that winds up making no difference.
1 comments

'white-space: pre' is what I learned there. Never knew such a thing could be possible. This means no need to do a 'nl2br' on the content if it contains no HTML, this is a common scenario, I am going to see if 'white-space: pre' just makes everything magically look okay.
The trick with that is that it also prevents wrapping except on new lines in the source. Looking at the potential values, I'd recommend pre-wrap instead, which at least allows avoiding horizontal scrolling, at the cost of requiring you to write the entire contents in a single line of markup. Annoyingly, it doesn't seem like there's a way to avoid multiple spaces being collapsed without also giving special meaning to keeping the source less than 120 characters (or whatever other measure) wide.