davidmerfield / Typeset

An HTML pre-proces­sor for web ty­pog­ra­phy
https://typeset.lllllllllllllllll.com/
Creative Commons Zero v1.0 Universal
2.41k stars 52 forks source link

Add support for avoiding widows #34

Open ajbouh opened 8 years ago

ajbouh commented 8 years ago

I would like to avoid the last 2 words in a paragraph from appearing on the last line by themselves.

For now I've been hacking around this by manually wrapping the last few words in a with a class that typeset is configured to ignore (to avoid soft-hyphens) and manually replacing spaces between those words with  .

Was this functionality intentionally omitted? If not, I'm happy to take a shot at implementing it myself.

ajbouh commented 8 years ago

@davidmerfield Any thoughts here?

davidmerfield commented 8 years ago

Hi! Sorry for the massive delay here. This functionality was not intentionally avoided. I'd be happy to accept a pull request adding this. I've added this to the to-do.

revelt commented 4 years ago

hi guys, I'm an author of string-remove-widows and Detergent.js, I was wondering, what's the status of this ticket?

I can help.

I'm into automated tooling, I rewrote whole apostrophes chapters of both Butterick and Oxford's A-Z Grammar and Punctuation on string-apostrophes. We're taking the copy processing very seriously in client-work and Typeset seems to take it to another level. I've just discovered it (quite late but better late than never). How awesome would it be if we had ALL typography issues fixed at once, in one program!

Back on the subject, @danielhaim1 if you're not done with the feature yet and do need help, let's regroup and code up the widow removal!