Quote:
Originally Posted by kovidgoyal
Assuming the source file has an even number of quotes, shouldn't replacing them with curly quotes be as simple as
|
It’s mostly mechanizable, but not quite that simply. For example:
“This quotation-marked bit goes on for more than one paragraph. It doesn’t end with a double quote.
“And here I have some ‘examples’ of single quotes. I’ve got several of ’em. The examples’ quotation marks point in all kinds of directions.
“And here ends the quote.”
So pretty much the rules are:
Code:
<ws>" == “
"<ws> == ”
\w'\w == ’
'<ws> == ’
<ws>' == ‘
Where <ws> is whitespace plus ( ) [ ] - – —.
But then have to manually check all the instances of “<ws>‘” and probaly start by looking for any quotations marks with white space on both sides (usually found when doing "something like 'this' ").
So anyway. Mostly mechanizable, but still some manual labor to get it perfect. And can’t automate improving the CSS. :-)