Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
yesbabyyes
on Dec 23, 2011
|
parent
|
context
|
favorite
| on:
Golden Ratio for Readable Web Typography
[...] dealing with orphans on the web is kind of impossible.
Not at all! Just:
html.replace(/\s+(\S+)$/mg, " $1")
EDIT: Bugfix, don't replace whitespace without any characters after, replace all occurrences in a multi-line text
54mf
on Dec 23, 2011
[–]
Well, yeah, but anything is possible with regex. (EXCEPT PARSING HTML, I KNOW.) I meant more along the lines of your typical HTML/CSS markup.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
Not at all! Just:
EDIT: Bugfix, don't replace whitespace without any characters after, replace all occurrences in a multi-line text