Automattic / Automattic/jetpack

googlemaps shortcode w=100%

Open
#15,967 0 comments 0 reactions 0 assignees View on GitHub
[Feature] Shortcodes / Embeds [Pri] Low Bug Good For Community
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

### Steps to reproduce the issue

1. Go to a page or post that is still in the classic editor mode (not converted to blocks yet) and create a googlemaps shortcode with a width in % like for example:
`[googlemaps https://www.google.com/maps/embed?pb=...&w=100%&h=450]`
2. Check public side to see the map is rendered in an iframe with width 100% (should be the case)
3. Go back to edit the page/post and convert it to the new editor blocks. Notice how the googlemaps shortcode gets correctly converted to a shortcode block with and the w=100% is still in there.
4. See public side again: the iframe is now 100px wide instead of 100%.

As a bonus:
5. Go back to edit the page/post again and now put the shortcode (with w=100%) in a Classic block instead of a Shortcode block.
6. Check public side again and notice it is still 100px wide...

#### What I expected
Same behavior as in classic editor / WordPress pre-gutenberg

#### What happened instead
Percentage values are seen as px values

https://wordpress.org/support/topic/googlemaps-shortcode-w100-issue/

Contributor guide

Open the contributing guide

Research direction

Start by locating the googlemaps shortcode handling and the conversion path from the classic editor to a Shortcode or Classic block. Compare the iframe width before and after conversion, then verify that a w=100% value remains percentage-based on the public page.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.