jacktuck / unfurl

Metadata scraper with support for oEmbed, Twitter Cards and Open Graph Protocol for Node.js :zap:
MIT License
475 stars 51 forks source link

Decode entity references in OEmbed hrefs #46

Closed trieloff closed 4 years ago

trieloff commented 4 years ago

We have had issues with a failing build in https://github.com/adobe/helix-embed/pull/84 caused by the inability to get proper OEmbeds from Youtube. Youtube uses & entity references in the OEmbed href, which unfurl is not parsing correctly – details laid out in #45

This PR fixes it by decoding the href using he before trying to retrieve and resolve the remote metadata.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 98.452% when pulling f3ca50cc62e04f42c9f5b5257ae3300b6ce82c5a on trieloff:decode-youtube-hrefs into 952c4031a9ae36a907349215a1b7fd82c91ab451 on jacktuck:master.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 98.452% when pulling f3ca50cc62e04f42c9f5b5257ae3300b6ce82c5a on trieloff:decode-youtube-hrefs into 952c4031a9ae36a907349215a1b7fd82c91ab451 on jacktuck:master.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 98.452% when pulling f3ca50cc62e04f42c9f5b5257ae3300b6ce82c5a on trieloff:decode-youtube-hrefs into 952c4031a9ae36a907349215a1b7fd82c91ab451 on jacktuck:master.

jacktuck commented 4 years ago

Haven't tested myself. Happy to take your word for it @trieloff. Thanks for the PR, LGTM

jacktuck commented 4 years ago

Published to npm, version5.0.0. Closes #45

trieloff commented 4 years ago

Awesome. Thanks for the speedy merge and release, Jack.

trieloff commented 4 years ago

@jacktuck it looks like the version published to NPM does not have the fix applied to the dist files.

jacktuck commented 4 years ago

🤦‍♂ I forgot this project was TS. Will do a patch later.

trieloff commented 4 years ago

Thanks, I was beginning to question my sanity when the tests in my project wouldn't pass, while the same test in your project did. Then I took a look at the dist.

jacktuck commented 4 years ago

@trieloff Just released Release 5.0.1 with a new build

github-actions[bot] commented 3 years ago

:tada: This PR is included in version 1.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: