Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
yesbabyyes
14y ago
0 comments
Share
[...] 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
0 comments
default
newest
oldest
54mf
14y ago
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.
j
/
k
navigate · click thread line to collapse