add JS escaping to template text, try and fix quotation escaping