Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { cache } from './cache.js';
import * as htmlUtils from './html-utils.js';
import log from '../logging.js';
import { resolve } from 'url';
import JSON5 from 'json5';

import CONFIG from '../config.loader.js';

Expand Down Expand Up @@ -343,6 +344,12 @@ export function parseJSONSource(text, decode) {
// default parser failed. Let's try to forgive
}

try {
return JSON5.parse(decode ? entities.decodeHTML(decode(text)) : entities.decodeHTML(text));
} catch (ex) {
// parser failed. Let's try to forgive more
}

var s = text;

// replace opening ( and closing )
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"htmlparser2": "^7.2.0",
"iconv-lite": "^0.6.3",
"jslint": "^0.12.1",
"json5": "^2.2.3",
"jsontoxml": "^1.0.1",
"memcached": "2.2.2",
"moment": "^2.30.1",
Expand Down