Skip to content

you can't insert a site-local image URL #20903

@skierpage

Description

@skierpage

Describe the bug
I want to insert existing images on my web site, i.e. the img src attribute for them will be /path/to/image.jpg. But for a long time and continuing in Gutenberg 7.7.1 , the editor's (Add image) > Insert from URL won't accept/resolve a local path, it displays a tooltip "Please enter a URL."

To reproduce
Steps to reproduce the behavior:

  1. Create a new post
  2. Click on '+' then 'image'
  3. Click 'Insert from URL'
  4. Enter the full path to an existing static image on the same web site as your Wordpress and Gutenberg, and press or click the '↵' symbol.
  5. See error: you get the tooltip and the mini-dialog remains up.

Expected behavior
The mini-dialog to insert from URL should be able to resolve the site-relative path and find the image just as it can when I include my domain name. That just seems like a bug.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Fedora 31 Linux
  • Browser: Firefox Nightly
  • Version: 76.0a1

Additional context
The workaround is to insert the full URL (//mysite.com/path/to/image.jpg won't work either, I have to include the https: scheme), then switch the block to HTML mode and manually delete https://mysite.com from the img src attribute.

(I know about the WordPress Media Library.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions