-
Notifications
You must be signed in to change notification settings - Fork 384
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
Update how Imgur IDs are parsed #5485
Conversation
This PR is in counterpart with ampproject/amphtml#30589 that fixes how singular Imgur IDs are sanitized. Currently embedding a Imgur gallery or album works fine, but if embedding a singular Imgur image, |
Plugin builds for 7a07dac are ready 🛎️!
|
So is #4697 valid? Instead of: <amp-imgur
data-imgur-id="2q6AS6i"
layout="responsive"
width="540"
height="633"
>
</amp-imgur> Should they have provided: <amp-imgur
data-imgur-id="a/2q6AS6i"
layout="responsive"
width="540"
height="633"
>
</amp-imgur> ? |
I would say it still is valid. Based on the reproduction steps provided the URL in question was https://imgur.com/gallery/2q6AS6i, which when previously parsed the ID would be |
I'm seeing the This is coming from the {
"version": "1.0",
"type": "rich",
"provider_name": "Imgur",
"provider_url": "https://imgur.com",
"width": 580,
"height": 870,
"html": "<blockquote class=\"imgur-embed-pub\" lang=\"en\" data-id=\"a/rAG6Q2w\"><a href=\"https://imgur.com/a/rAG6Q2w\">View post on imgur.com</a></blockquote><script async src=\"//s.imgur.com/min/embed.js\" charset=\"utf-8\"></script>"
} There is no amp-wp/includes/embeds/class-amp-imgur-embed-handler.php Lines 52 to 68 in 5e85cc8
|
The |
The excessive height seems to be a bug with Imgur's data response. Nevertheless, should we be parsing the |
Yea it does seem to be dead code. I'll remove it. |
Rebasing onto |
1acc7f6
to
7a07dac
Compare
But https://imgur.com/2q6AS6i/embed?pub=true is a failure whereas https://imgur.com/a/2q6AS6i/embed?pub=true succeeds. So then with the reversion of ampproject/amphtml#30589 wouldn't this be required? <amp-imgur
data-imgur-id="a/2q6AS6i"
layout="responsive"
width="540"
height="633"
>
</amp-imgur> |
Wait, so this is the case actually. In #4697 the issue was for embedding https://imgur.com/gallery/2q6AS6i. Before this PR it was generating (which currently works until ampproject/amphtml#30589 is merged): <amp-imgur width="580" height="870" data-imgur-id="2q6AS6i" class="i-amphtml-layout-fixed i-amphtml-layout-size-defined" style="width:580px;height:870px;" i-amphtml-layout="fixed"></amp-imgur> Whereas with this PR, the result is: <amp-imgur width="580" height="870" data-imgur-id="a/2q6AS6i" class="i-amphtml-layout-fixed i-amphtml-layout-size-defined" style="width:580px;height:870px;" i-amphtml-layout="fixed"></amp-imgur> The explicit |
Summary
Fixes #5482
Fixes #4697
Checklist