Skip to content

Commit

Permalink
fix: change regex to match lightning emoji
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Jun 23, 2022
1 parent 22bf9eb commit 07ab48c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/extension/content-script/batteries/GitHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ function parseElement(elementSelector: string) {
const match = text.match(/(⚡:?|lightning:|lnurl:)\s?(\S+@\S+)/i);
if (match) return match[2];
}

// Fallback for Windows and Linux
const zap = document
.querySelector<HTMLElement>(elementSelector)
?.querySelector('[alias="zap"]');
if (zap) {
const lnaddress = zap.nextSibling?.textContent as string;
const match = lnaddress.match(/(:?)\s?(\S+@\S+)/i);
if (match) return match[2];
}
}

function handleProfilePage() {
Expand Down

0 comments on commit 07ab48c

Please sign in to comment.