diff --git a/lib/utils.js b/lib/utils.js index cd7956f4..e80bb74f 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -3,7 +3,12 @@ import * as Settings from "./settings"; export function parseJson(json) { try { - return JSON.parse(json); + // clean up JSON that contains escape sequences, + // such as: `\\` or with `\"` + let cleanedJson = json + .replace(/\\/g, "\\\\") + .replace(/\\\"/g, '"'); + return JSON.parse(cleanedJson); } catch (error) { // eslint-disable-next-line no-console console.error(error, json);