Hacker News new | past | comments | ask | show | jobs | submit login

`white-space: pre-wrap` is the solution to this. It's pre, but with wrapping when it's needed :)



It'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.


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


cc @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




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: