mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Fix crash decoding url
This commit is contained in:
parent
3e93b42251
commit
6ac4c072a6
1 changed files with 2 additions and 2 deletions
|
|
@ -18,7 +18,7 @@ const linkifyOpts: linkify.Opts = {
|
||||||
return `<a class=\"mention hashtag\" href=\"${href}\" rel=\"tag\"><span>#</span>${tag}</a>`;
|
return `<a class=\"mention hashtag\" href=\"${href}\" rel=\"tag\"><span>#</span>${tag}</a>`;
|
||||||
},
|
},
|
||||||
url: ({ content }) => {
|
url: ({ content }) => {
|
||||||
if (nip21.test(content)) {
|
try {
|
||||||
const { decoded } = nip21.parse(content);
|
const { decoded } = nip21.parse(content);
|
||||||
const pubkey = getDecodedPubkey(decoded);
|
const pubkey = getDecodedPubkey(decoded);
|
||||||
if (pubkey) {
|
if (pubkey) {
|
||||||
|
|
@ -28,7 +28,7 @@ const linkifyOpts: linkify.Opts = {
|
||||||
} else {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
} else {
|
} catch {
|
||||||
return `<a href="${content}">${content}</a>`;
|
return `<a href="${content}">${content}</a>`;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue