Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support badly formatted json #84

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

n-sviridenko
Copy link

No description provided.

Copy link
Collaborator

@mvolz mvolz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We wouldn't add the yarn.lock so this should be be removed from the PR.

Thanks for submitting this!

@@ -6,7 +6,8 @@
"dependencies": {
"bluebird": "3.5.1",
"cheerio": "1.0.0-rc.2",
"microdata-node": "0.2.1",
"js-yaml": "^3.13.1",
"microdata-node": "https://github.com/n-sviridenko/microdata-node#a6b2eee9c383668a18ee467b96179dccd67af715",
Copy link
Collaborator

@mvolz mvolz Aug 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pointing to this fork should be a separate PR... we'd have to review the replacement in more detail.

contents = JSON.parse(this.children[0].data);
// some websites have multiline strings in their JSON
// and they're valid as per https://search.google.com/structured-data/testing-tool
contents = yaml.safeLoad(this.children[0].data, yaml.JSON_SCHEMA);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add a test for the multiline string?

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