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.
}
return (
mapping[href] ||
(relativeHref ? mapping[relativeHref] : undefined) ||
href
);
for (const originalUrl of Object.keys(mapping)) {
if (
href.startsWith(originalUrl) ||
relativeHref?.startsWith(originalUrl)
) {
return mapping[originalUrl];
}
}
return href;
}
function replaceAttachmentUrls(node: ProsemirrorData) {