Skip to content

Conversation

@rnystrom
Copy link
Contributor

@rnystrom rnystrom commented Dec 3, 2024

Some sites that I'm parsing OG data on have empty LD+JSON. This crashes in JSON.parse. The fix is simply to trim the content before parsing, which results in a no-op.

@jshemas
Copy link
Owner

jshemas commented Dec 3, 2024

Great catch! Thanks for the PR.

@jshemas jshemas merged commit 40a50e0 into jshemas:master Dec 3, 2024
4 checks passed
@jshemas
Copy link
Owner

jshemas commented Dec 4, 2024

Changes are live in open-graph-scraper@6.8.3

@rnystrom rnystrom deleted the rn/ld-json-whitespace branch December 4, 2024 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants