forked from nostr/nostrweb
content: fix parse links with uppercase characters
ignore case sensitivity when checking for possible links
parent
a73af8bb78
commit
5a31d78a07
|
@ -104,11 +104,12 @@ export const parseTextContent = (
|
||||||
return elem('a', {href: `/${npub}`, data: {profile: data}}, data.slice(6, 15))
|
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;
|
return word;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (!word.startsWith('http')) {
|
if (!WORD.startsWith('HTTP')) {
|
||||||
word = 'https://' + word;
|
word = 'https://' + word;
|
||||||
}
|
}
|
||||||
const url = new URL(word);
|
const url = new URL(word);
|
||||||
|
|
Loading…
Reference in New Issue