Skip to content

Commit

Permalink
Only allow whitespace around URL pasting for Embed #5340 #4799 (#5385)
Browse files Browse the repository at this point in the history
  • Loading branch information
bordoni authored and aduth committed Mar 7, 2018
1 parent 6727993 commit b1e85f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion blocks/library/embed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export const settings = getEmbedBlockSettings( {
from: [
{
type: 'raw',
isMatch: ( node ) => node.nodeName === 'P' && /^\s*(https?:\/\/\S+)\s*/i.test( node.textContent ),
isMatch: ( node ) => node.nodeName === 'P' && /^\s*(https?:\/\/\S+)\s*$/i.test( node.textContent ),
transform: ( node ) => {
return createBlock( 'core/embed', {
url: node.textContent.trim(),
Expand Down

0 comments on commit b1e85f5

Please sign in to comment.