Open rachelmcr opened 5 years ago
It looks like the pasted content is considered "inline" and later the image is stripped.
Hat tip to Jim Grey for describing the issue, leading to this report.
Hi, all. The same issue occurs on my site running on Windows 10.
Greetings.
Hat tip to Jim Grey for describing the issue, leading to this report.
Hi, all. The same issue occurs on my site running on Windows 10.
Greetings.
I have the same issue on my site, hosted by ProHosting, although I can't recall when it began. I am hoping this gets resolved or easier as I use a lot of photos from Flickr.
I ran into this recently on a site and it appears to not limited to Flickr, but instead is any image within a link tag.
We are currently on WP 5.2.4.
For example, the following text will result in the link being retained and the image stripped:
<a href="https://live.staticflickr.com/65535/50062868321_873075c0ed_o.png"><img src="https://live.staticflickr.com/65535/50062868321_8bf3a6fecc_h.jpg"></a>
results in
<!-- wp:paragraph -->
<p><a href="https://live.staticflickr.com/65535/50062868321_873075c0ed_o.png"></a></p>
<!-- /wp:paragraph -->
Whereas pasting in the image pasted in itself is handled correctly:
<img src="https://live.staticflickr.com/65535/50062868321_8bf3a6fecc_h.jpg">
results in:
<!-- wp:paragraph -->
<p class=""><img src="https://live.staticflickr.com/65535/50062868321_8bf3a6fecc_h.jpg"></p>
<!-- /wp:paragraph -->
Did another experiment with breaking the HTML with soft line breaks and it strips the link completely:
<a href="https://live.staticflickr.com/65535/50062868321_873075c0ed_o.png">
<img src="https://live.staticflickr.com/65535/50062868321_8bf3a6fecc_h.jpg">
</a>
turns into:
<!-- wp:image -->
<figure class="wp-block-image"><img src="https://live.staticflickr.com/65535/50062868321_8bf3a6fecc_h.jpg" alt=""/></figure>
<!-- /wp:image -->
Given the timing of the first report here, I would guess (still need to dig further to verify) that https://github.com/WordPress/gutenberg/pull/17140/files may be the culprit.
I can still reproduce the issue. For next steps I think we'll want to investigate if this is a more general issue. A unit test for the paste handler might make sense.
https://user-images.githubusercontent.com/1270189/115773080-bc87b700-a364-11eb-968a-4d142ef94f4d.mp4
Describe the bug
When pasting Flickr embed code in a paragraph block, the image tag is stripped out of the block.
This is a regression in the Gutenberg 6.6.0 beta. The embed code works as expected in the release version of Gutenberg in WordPress 5.2.3.
To reproduce Steps to reproduce the behavior:
Here's an example Flickr image: https://www.flickr.com/photos/mobilene/48726201381/in/dateposted/
And the console output for that embed:
Expected behavior I expect the embed code to be processed such that I'm left with an embedded image linked to Flickr.
This is the expected console output (observed without the Gutenberg plugin enabled):
Desktop (please complete the following information):
Additional context Hat tip to Jim Grey for describing the issue, leading to this report.