Open ryneeverett opened 10 years ago
Thanks for the fix! I don't have time to check this right away, but I'll try and get it tested and merged this week!
@mintchaos , @chrisdrackett , @justinmayer , please, review this pull request.
Thanks.
@ryneeverett: Please accept my sincere apologies for the absurdly long delay in reviewing your contribution. Truly.
In my cursory review of the changed output, it does indeed seem improved when there is a newline in-between the last two words. I found a case, however, in which the presence of two spaces were previously replaced with a
, but the new regex in this PR leaves those two spaces in place. For example:
“Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.” —Socrates
Following is how Typogrify treats the two spaces between the closing quotation mark and the em-dash above:
 
That leaves me with two questions:
I don't have much more insight into what I was thinking six years ago than you do. :) If that's indeed the effect then I'd agree this change is not beneficial. Feel free to close.
Fix #38.
Widont shouldn't count newlines as spaces. This is achieved with a regex inspired by this SO post. Rather than checking for a space (which includes newlines), we check for both (a) not not a space, and (b) not a newline.