-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat(Experimental): add support for metaformats #229
Conversation
@aciccarello wow thanks for putting the time in to getting this working. Sorry I didn't see this earlier, I will get round to reviewing this shortly. Once again, really appreciate this contribution 💯 |
Welcome! I'm happy to discuss any changes you think should be made. |
It might be a short discussion 😄 I've had a read and can't in all honesty find anything I would insist on changing 👍 |
should fix test ordering issue
Fixes #224
Based on PR #226
Checklist
Changes to parsing behaviour
Adds an optional experimental option to fallback to parsing meta tags. This was inspired by the metaformats spec but with some significant changes.
og:type
featured
rather thanphoto
onog:image
to avoid implying a photo post (matches opengraph-mf2 implementation)The parsing approach needed to change significantly from the metaformats spec due to a few challenges with tag order. By parsing all the meta tags before creating the microformats item, we can prefer some tags over others and also handle complex tags like
og:image
+og:image:alt
.Example input covered by new behaviour
Source HTML of #224
Example output from new behaviour
Other changes
isTag('tagName')
helper for finding child nodes.Other considerations
og:locale
for the lang?