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

Look in entire document for Schema.org metadata not just head #1664

Merged
merged 1 commit into from
Nov 28, 2018

Conversation

westonruter
Copy link
Member

The JSON-LD script elements can appear anywhere in a document, not just the head. This fixes the detection to account for that so that when another plugin outputs Schema.org metadata, the AMP plugin won't output a duplicate.

Fixes #1659

@westonruter westonruter added this to the v1.0 milestone Nov 27, 2018
@westonruter westonruter requested a review from kienstra November 27, 2018 23:18
@kienstra
Copy link
Contributor

Approved

Hi @westonruter,
This looks good. I also saw that the plugin doesn't output Schema.org metadata if it's already in the document, like in the footer:

schema-appears-footer

And if the metadata isn't already present, the plugin still outputs it like before.

@westonruter westonruter merged commit 19a043a into 1.0 Nov 28, 2018
@swissspidy swissspidy deleted the fix/schema-metadata-detection branch June 18, 2019 12:27
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