Skip to content

Commit

Permalink
make the regex accept spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian committed Jan 6, 2020
1 parent 820edd0 commit 624ff3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extensions/blocks/calendly/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ const getUrlAndStyleFromEmbedCode = embedCode => {
};
}

urlFromRegex = embedCode.match( / *Calendly\.initPopupWidget\({* url: *["']?([^"']*)/i );
urlFromRegex = embedCode.match( / *Calendly\.initPopupWidget\({ *url: *["']?([^"']*)/i );
if ( urlFromRegex && urlFromRegex[ 1 ] && urlFromRegex[ 1 ].indexOf( 'http' ) === 0 ) {
return {
style: 'link',
url: urlFromRegex[ 1 ],
};
}

urlFromRegex = embedCode.match( / *Calendly\.initBadgeWidget\({* url: *["']?([^"']*)/i );
urlFromRegex = embedCode.match( / *Calendly\.initBadgeWidget\({ *url: *["']?([^"']*)/i );
if ( urlFromRegex && urlFromRegex[ 1 ] && urlFromRegex[ 1 ].indexOf( 'http' ) === 0 ) {
return {
style: 'link',
Expand Down

0 comments on commit 624ff3b

Please sign in to comment.