Skip to content

Commit ff1f714

Browse files
committed
Handle JSON with trailing semicolon
1 parent 48bf38f commit ff1f714

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/parsers/jsonld-parser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function (html, config = {}) {
77

88
$html('script[type="application/ld+json"]').each((index, item) => {
99
try {
10-
let parsedJSON = JSON.parse($(item).text())
10+
let parsedJSON = JSON.parse($(item).text().trim().replace(/;$/, ''))
1111
if (!Array.isArray(parsedJSON)) {
1212
parsedJSON = [parsedJSON]
1313
}

0 commit comments

Comments
 (0)