Skip to content

Image Block: images with data URI does not render properly on save #44728

Open
@annemirasol

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

  1. Go to the block editor.
  2. Insert an Image block (/image) and choose Insert from URL...
  3. Paste the Data URI of an image. (For testing, I used Google Images search, double-clicked an image, and choosed Copy image address.)
  4. Paste the data URI in the Image block's URL field. Notice that it renders properly inside the editor.
  5. 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

https://d.pr/v/ftRpYm

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    BlocksEditor blocks, aka Gutenberg blocks, plugins, and extensions[Pri] NormalSchedule for the next available opportuinity.[Status] Stale[Type] Bug

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions