5 ms·
Because it's not a text organised into sections, paragraphs and whatnot with html, it's just a plain text file rendered into one big paragraph with whitespace s
by _kblcuk_ 3y ago
Because it's not a text organised into sections, paragraphs and whatnot with html, it's just a plain text file rendered into one big paragraph with whitespace set to `pre` ¯\_(ツ)_/¯.
- madeofpalk 3y ago`white-space: pre-wrap` is the solution to this. It's pre, but with wrapping when it's needed :)
- _kblcuk_ 3y agocc @j3s (I wonder if this even works here), here's your line breaks fix :) (assuming that since HN is mentioned in git repo [0] for the site, the author does read this occasionally) [0] https://git.j3s.sh/j3s.sh https://git.j3s.sh/j3s.sh
- montroser 3y agoIt's arguable whether this is better or worse, because now you'll have the text wrapping where needed _but also_ again where it would have on a wider viewport, even though it already wrapped. So on mobile you'll have a full line, then half a line, then a full line, then half a line, and so on, wrapping alternatingly at the natural edge of the viewport, and again at the original line end terminated by a line break.
- DougBTX 3y agoIt probably changes from person to person, but while I find wrapping like that harder to read than seeing it all normally, for code it is still much better than scrolling back and forth for every line.