@zipify/wysiwyg 1.2.5 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/lib/entry-cli.js +2 -1
- package/package.json +1 -1
package/lib/entry-cli.js
CHANGED
|
@@ -9,6 +9,7 @@ function rubifyJSON(object) {
|
|
|
9
9
|
const json = JSON.stringify(object, skipNullValue, 2);
|
|
10
10
|
|
|
11
11
|
return json
|
|
12
|
+
.replace(/'/g, '\'')
|
|
12
13
|
.replace(/^[\t ]*"[^:\n\r]+(?<!\\)":/gm, (match) => match.replace(/"/g, ''))
|
|
13
14
|
.replace(/: "(.+)"([,\n])/g, ': \'$1\'$2');
|
|
14
15
|
}
|
|
@@ -19,7 +20,7 @@ program.command('to-json')
|
|
|
19
20
|
.action((html, { config }) => {
|
|
20
21
|
const configPath = resolve(process.cwd(), config);
|
|
21
22
|
const serializer = ContentSerializer.build(require(configPath).editor);
|
|
22
|
-
const json = rubifyJSON(serializer.toJSON(html));
|
|
23
|
+
const json = rubifyJSON(serializer.toJSON(html.replace(/\\"/g, '"')));
|
|
23
24
|
|
|
24
25
|
// eslint-disable-next-line no-console
|
|
25
26
|
console.log(json);
|