Looking for a solution to convert regular straight quotes into curly quotes in a Javascript-based rules engine application. Rather than just using a simple string.replace for ["], I need a method that will insert the correct curly quote depending on its position.
My idea is to replace the first occurrence of a quote with a left curly quote and alternate the following ones between left and right curly quotes. Is there a way to achieve this using Javascript?