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

Load all JSON-LD data #519

Merged
merged 4 commits into from
Jun 28, 2023
Merged

Conversation

brianlmoon
Copy link
Contributor

The LinkedData class was only grabbing the first application/ld+json
script tag found in the DOM. It now finds them all and makes them
all available via the getAll method. Additionally, it inspects the
mainEntityOfPage property of the json nodes and if a match is found
with the request URI, that node is assigned as the default node
rather than the first node found.

The LinkedData class was only grabbing the first application/ld+json
script tag found in the DOM. It now finds them all and makes them
all available via the getAll method. Additionally, it inspects the
mainEntityOfPage property of the json nodes and if a match is found
with the request URI, that node is assigned as the default node
rather than the first node found.
@oscarotero
Copy link
Owner

Thanks!
Running the tests, it seems that PHP 8.1 treats some characters in JSON-LD differently.

@brianlmoon
Copy link
Contributor Author

I will have a look at 8.1, thanks.

@brianlmoon
Copy link
Contributor Author

Yep, the default flags for html_entity_decode changed in PHP 8.1

 flags changed from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401. 

@brianlmoon
Copy link
Contributor Author

Tested on 8.0 and 8.1. I don't have 7.4 anywhere around to test with though. Hopefully it passes OK as well with this change.

@oscarotero oscarotero merged commit 530593a into oscarotero:master Jun 28, 2023
@oscarotero
Copy link
Owner

thanks! the tests keep failing but it's due a different issue.

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