Skip to content

Commit

Permalink
Merge pull request #524 from secondl1ght/regex-update
Browse files Browse the repository at this point in the history
Update regex to allow for whitespace before ln address
  • Loading branch information
bumi authored Jan 18, 2022
2 parents 5c686ae + 49c299e commit f3df215
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/extension/content-script/batteries/Peertube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const battery = (): void => {
}
// if there is no lnurl we check for a zap emoji with a lightning address
// we check for the @-sign to try to limit the possibility to match some invalid text (e.g. random emoji usage)
else if ((match = text.match(/(:?|lightning:|lnurl:)(\S+@\S+)/i))) {
else if ((match = text.match(/(:?|lightning:|lnurl:)\s?(\S+@\S+)/i))) {
recipient = match[2];
} else {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/extension/content-script/batteries/YouTubeVideo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const battery = (): void => {
}
// if there is no lnurl we check for a zap emoji with a lightning address
// we check for the @-sign to try to limit the possibility to match some invalid text (e.g. random emoji usage)
else if ((match = text.match(/(:?|lightning:|lnurl:)(\S+@\S+)/i))) {
else if ((match = text.match(/(:?|lightning:|lnurl:)\s?(\S+@\S+)/i))) {
recipient = match[2];
} else {
return;
Expand Down

0 comments on commit f3df215

Please sign in to comment.