Skip to content

Commit f3df215

Browse files
authored
Merge pull request getAlby#524 from secondl1ght/regex-update
Update regex to allow for whitespace before ln address
2 parents 5c686ae + 49c299e commit f3df215

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/extension/content-script/batteries/Peertube.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const battery = (): void => {
5959
}
6060
// if there is no lnurl we check for a zap emoji with a lightning address
6161
// we check for the @-sign to try to limit the possibility to match some invalid text (e.g. random emoji usage)
62-
else if ((match = text.match(/(:?|lightning:|lnurl:)(\S+@\S+)/i))) {
62+
else if ((match = text.match(/(:?|lightning:|lnurl:)\s?(\S+@\S+)/i))) {
6363
recipient = match[2];
6464
} else {
6565
return;

src/extension/content-script/batteries/YouTubeVideo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const battery = (): void => {
2222
}
2323
// if there is no lnurl we check for a zap emoji with a lightning address
2424
// we check for the @-sign to try to limit the possibility to match some invalid text (e.g. random emoji usage)
25-
else if ((match = text.match(/(:?|lightning:|lnurl:)(\S+@\S+)/i))) {
25+
else if ((match = text.match(/(:?|lightning:|lnurl:)\s?(\S+@\S+)/i))) {
2626
recipient = match[2];
2727
} else {
2828
return;

0 commit comments

Comments
 (0)