Update ogp.js to support any Open Graph namespace/prefixes. #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The old version of the script was limited to only parsing for the og namespace. This revision adds support for parsing for any namespaces desired, which unfortunately breaks the expected response for prior implementations however it is a necessary improvement.
As a note the old implementation failed to work on sites following current Open Graph standards from http://ogp.me due to modifications in the namespace prefix declaration. This revision forgoes the forcing of prefix detection from jsdom since the Open Graph standard has changed at least three times that I am aware of.
I updated the package.json version a major revision, since updating the module would break any existing implementations expecting results such as { title: 'Title value' } which would now be { 'og:title': 'Title value' } due to the multiple namespace support.