Image Block: images with data URI does not render properly on save #44728
Open
Description
When using a Data URI for the Image block (using "Insert from URL"), the image renders okay while inside the editor, but doesn't render after saving.
The HTML generated while inside the editor (data URI truncated for convenience).
<figure class="wp-block-image size-large"><img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ...=" alt=""/></figure>
The HTML generated after saving (inside the post). I noticed that the data:
part of the src
value was dropped.
<figure class="wp-block-image size-large"><img src="image/jpeg;base64,/9j/4AAQSkZJRgABAQ...=" alt=""/></figure>
Steps to reproduce
- Go to the block editor.
- Insert an Image block (
/image
) and chooseInsert from URL...
- Paste the Data URI of an image. (For testing, I used Google Images search, double-clicked an image, and choosed
Copy image address
.) - Paste the data URI in the Image block's URL field. Notice that it renders properly inside the editor.
- Save your post and view. Notice that the image is not rendered.
What I expected
I expected the image to render even after saving.
What happened instead
The image doesn't render.
Browser / OS version
- macOS Catalina Version 10.15.6
- Google Chrome Version 84.0.4147.105 (Official Build) (64-bit)
Screenshot / Video
Context / Source
I was demo-ing the block editor to a friend (who was then using Microsoft Edge browser) when this happened. I can replicate consistently using above-described Mac and Chrome setup. #user-report
Activity