fix: Correctly replace urls with signed versions when display=link

This commit is contained in:
Tom Moor
2024-05-29 23:35:03 -04:00
parent 1ceb87515d
commit 30c43690c0

View File

@@ -213,11 +213,16 @@ export class ProsemirrorHelper {
// Noop: Invalid url. // Noop: Invalid url.
} }
return ( for (const originalUrl of Object.keys(mapping)) {
mapping[href] || if (
(relativeHref ? mapping[relativeHref] : undefined) || href.startsWith(originalUrl) ||
href relativeHref?.startsWith(originalUrl)
); ) {
return mapping[originalUrl];
}
}
return href;
} }
function replaceAttachmentUrls(node: ProsemirrorData) { function replaceAttachmentUrls(node: ProsemirrorData) {