diff --git a/src/utils/dom.ts b/src/utils/dom.ts index fcfd1b4..b408618 100644 --- a/src/utils/dom.ts +++ b/src/utils/dom.ts @@ -104,11 +104,12 @@ export const parseTextContent = ( return elem('a', {href: `/${npub}`, data: {profile: data}}, data.slice(6, 15)) } } - if (!word.match(/^(https?:\/\/|www\.)\S*/)) { + const WORD = word.toUpperCase(); + if (!WORD.match(/^(HTTPS?:\/\/|WWW\.)\S*/)) { return word; } try { - if (!word.startsWith('http')) { + if (!WORD.startsWith('HTTP')) { word = 'https://' + word; } const url = new URL(word);