jeudi 19 février 2015

Javascript string replace removes all double quotes


The title says it all. I want to insert HTML strings into a file. finalHTML looks perfectly fine, while master does not contain any double quotes after the first line of finalHTML.



console.log(finalHTML); //this contains double quotes
master = master.toString('utf8').replace(/<svg.*?>.*<\/svg>/im, finalHTML);
console.log(master); //this does not.




Aucun commentaire:

Enregistrer un commentaire