don't render nostr:npub as a link

People often type the literal text `nostr:npub` when talking about nostr URIs. That shouldn't be converted to a link.
This commit is contained in:
Sam Samskies 2023-04-19 13:57:58 -05:00
parent cc1d42c517
commit 9b2fb3b6bf
No known key found for this signature in database
GPG Key ID: E3F697EE1B6EB156
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ export default function Text({ content, tags, creator, disableMedia, depth }: Te
.map(f => {
if (typeof f === "string") {
return splitByUrl(f).map(a => {
if (a.match(/^(?:https?|(?:web\+)?nostr|magnet):/i)) {
if (a.match(/^(?:https?|(?:web\+)?nostr|magnet):/i) && a.toLowerCase() !== "nostr:npub") {
if (disableMedia ?? false) {
return (
<a href={a} onClick={e => e.stopPropagation()} target="_blank" rel="noreferrer" className="ext">