Skip to content
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

Image blocks with www links append the site's base URL to the link. #57305

Closed
KirkwallDay opened this issue Oct 24, 2021 · 3 comments
Closed
Assignees
Labels
Cross Repo Tracker For issues that are tracking issues in other repositories [Feature] Post/Page Editor The editor for editing posts and pages. [Pri] Low Address when resources are available. [Type] Bug

Comments

@KirkwallDay
Copy link

Quick summary

If you add a link to an image in Gutenberg with the www subdomain, the link will appear on the live site with the base URL of the WordPress site appended to the link address.

Steps to reproduce

  1. Create an image block in the editor. Link it as so (www.speedtest.net is used as an example here):

Image Link Bug Simple Link Cap

2. Go into preview or the live site, and hover over the image:

Link Bug end result

3. Clicking the link will result in a 404 error on the wordpress site, as it tries to go to: https://wordpress-site/www.speedtest.net

What you expected to happen

The link should follow the same behaviour as links added in paragraph blocks: The www. site should be linked correctly.

What actually happened

The link 404's as the base wordpress site URL is appended to the beginning of the link.

Context

A user discovered this behaviour here: 4024683-hc

Operating System

macOS

Browser

Mozilla Firefox

Simple, Atomic or both?

Simple, Atomic

Theme-specific issue?

No response

Other notes

No response

Reproducibility

Consistent

Severity

All

Available workarounds?

Yes, easy to implement

Workaround details

Removing the link from the image block, and then re-adding it as https://www.link.com will work.

Removing the image block and re-adding it may be necessary.

@Robertght
Copy link

Thank you for reporting this @KirkwallDay !

It looks like this is Gutenberg-related as I was able to replicate it on a self-hosted environment as well:

WordPress/gutenberg#35910

@Robertght Robertght added the [Feature] Post/Page Editor The editor for editing posts and pages. label Oct 25, 2021
@dpasque dpasque added the [Pri] Low Address when resources are available. label Oct 25, 2021
@dpasque dpasque added the Cross Repo Tracker For issues that are tracking issues in other repositories label Oct 25, 2021
@dpasque
Copy link
Contributor

dpasque commented Oct 25, 2021

This issue is tracking an issue in another repository. All +1's of end-user reports should be done on this issue, while any discussion related to the issue itself and its fix should be done on the issue in the outside repository.

@yansern yansern self-assigned this Nov 9, 2021
@yansern
Copy link
Contributor

yansern commented Nov 9, 2021

This is default browser behaviour. WP or Gutenberg just outputs the link as-is.

You can test this on all other browsers (tested on Chrome, Firefox & Safari).
https://jsbin.com/yeroretoma/edit?html,output

The user should add protocols to the image link. Marking this as Won't Fix.

@yansern yansern closed this as completed Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cross Repo Tracker For issues that are tracking issues in other repositories [Feature] Post/Page Editor The editor for editing posts and pages. [Pri] Low Address when resources are available. [Type] Bug
Projects
None yet
Development

No branches or pull requests

4 participants