smartquotes.js
smartquotes.js copied to clipboard
Quotations containing non-word characters end up backwards at the start
Currently, a quotation such as:
"(They) are our trusted and respected neighbours, business partners, and friends," read a press release.
Gets converted into:
”(They) are our trusted and respected neighbours, business partners, and friends,” read a press release.
Note the backwards character at the start.
The issue is on Line 5 of replacements.js. Changing the regex to something like (\W|^)"(\w|\(|')
would account for a parenthesis or single quote at the start of a quotation, which is not uncommon. Do you see any other problems with a change like this?
I just want to second this issue and add that it is fairly common to have the first character in a quote be [. This is because brackets are used to indicate that the quote, including the capitalization of the first letter, has been changed. Consequently, "This is a quote" might be excerpted to "[A] quote." or used in a sentence like: I have already mentioned that "[t]his is a quote."). Indicating changes in this manner is required by MLA style (MLA Handbook 8th, 75) and Bluebook style (Rule 5.2(a)) and is permitted in Chicago Style (CMS 2003, 447).