Regex for curly quotes and apostrophes
Since you know that the double quotes will always be matched, you might try this instead of your first two replaces:

r.replace(/"([^"]*)"/g, "“$1”")


I think that's a little stronger.  The unmatched single quotes are harder, and I think what you have is reasonable.  I might try this tack though if JavaScript has the \w for word letters.  (If not, use [a-zA-Z].)

.replace(/(\w)'(\w)/g, "$1’$2")
.replace(/'([^']*)'/g, "‘$1’")