mirror of
https://github.com/docmost/docmost.git
synced 2026-05-16 22:41:30 +08:00
feat(editor): audio and PDF nodes (#2064)
* use local resizable * feat: aduio * support audio imports * feat: use confluence real file names * cleanup * error handling * hide notice * add audio * fix pulse * Fix import and export * unify pulse * hide in readonly mode * keywords * keyword * translations * better sort * feat: PDF embed * cleanup * remove audio menu * open active * hide focus on readonly mode * increase iframe default dimension
This commit is contained in:
@@ -41,6 +41,15 @@ export function resolveRelativeAttachmentPath(
|
||||
'ImportUtils',
|
||||
);
|
||||
}
|
||||
|
||||
// Confluence Server uses "/download/attachments/..." in HTML but the ZIP
|
||||
// stores files under "attachments/...". Strip the "download/" prefix so
|
||||
// the path can match candidates from the archive.
|
||||
const confluenceStripped = mainRel.replace(
|
||||
/^download\/attachments\//,
|
||||
'attachments/',
|
||||
);
|
||||
|
||||
const fallback = path
|
||||
.normalize(path.join(pageDir, mainRel))
|
||||
.split(path.sep)
|
||||
@@ -49,9 +58,13 @@ export function resolveRelativeAttachmentPath(
|
||||
if (attachmentCandidates.has(mainRel)) {
|
||||
return mainRel;
|
||||
}
|
||||
if (confluenceStripped !== mainRel && attachmentCandidates.has(confluenceStripped)) {
|
||||
return confluenceStripped;
|
||||
}
|
||||
if (attachmentCandidates.has(fallback)) {
|
||||
return fallback;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user