From 07ab48cf9d519478b3521eb72abd81ef9ab60a75 Mon Sep 17 00:00:00 2001 From: im-adithya Date: Fri, 24 Jun 2022 00:04:57 +0530 Subject: [PATCH] fix: change regex to match lightning emoji --- src/extension/content-script/batteries/GitHub.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/extension/content-script/batteries/GitHub.ts b/src/extension/content-script/batteries/GitHub.ts index fb14fc6d17..65c64796a1 100644 --- a/src/extension/content-script/batteries/GitHub.ts +++ b/src/extension/content-script/batteries/GitHub.ts @@ -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(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() {