Skip to content

Commit

Permalink
Merge pull request #9670 from ckeditor/i/2762
Browse files Browse the repository at this point in the history
Fix (media-embed): Added support for more google maps URL formats (goo.gl/maps, maps.google.com, maps.app.goo.gl). Closes #2762.
  • Loading branch information
mlewand authored May 25, 2021
2 parents 3dbbadd + 97ef6ed commit a5991c9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/ckeditor5-media-embed/src/mediaembedediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,12 @@ export default class MediaEmbedEditing extends Plugin {
},
{
name: 'googleMaps',
url: /^google\.com\/maps/
url: [
/^google\.com\/maps/,
/^goo\.gl\/maps/,
/^maps\.google\.com/,
/^maps\.app\.goo\.gl/
]
},
{
name: 'flickr',
Expand Down
16 changes: 16 additions & 0 deletions packages/ckeditor5-media-embed/tests/mediaembedediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,22 @@ describe( 'MediaEmbedEditing', () => {
] );
} );

it( 'upcasts the URL (google maps short URL)', () => {
testMediaUpcast( [
'https://goo.gl/maps/foo',
'goo.gl/maps/foo'
] );
} );

it( 'upcasts the URL (google maps for Android)', () => {
testMediaUpcast( [
'https://maps.google.com',
'https://maps.app.goo.gl',
'maps.google.com',
'maps.app.goo.gl'
] );
} );

it( 'upcasts the URL (flickr)', () => {
testMediaUpcast( [
'https://www.flickr.com/foo/bar',
Expand Down
3 changes: 3 additions & 0 deletions packages/ckeditor5-media-embed/theme/mediaembedediting.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

&[data-oembed-url*="twitter.com"],
&[data-oembed-url*="google.com/maps"],
&[data-oembed-url*="goo.gl/maps"],
&[data-oembed-url*="maps.google.com"],
&[data-oembed-url*="maps.app.goo.gl"],
&[data-oembed-url*="facebook.com"],
&[data-oembed-url*="instagram.com"] {
& .ck-media__placeholder__icon * {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a5991c9

Please sign in to comment.