mirror of
https://github.com/docmost/docmost.git
synced 2026-05-14 20:54:07 +08:00
feat: refactor link menu (#2025)
* link markview - WIP * WIP * feat: refactor links * cleanup
This commit is contained in:
@@ -291,6 +291,7 @@ export class ExportService {
|
||||
prosemirrorJson,
|
||||
slugIdToPath,
|
||||
currentPagePath,
|
||||
baseUrl,
|
||||
);
|
||||
|
||||
if (includeAttachments) {
|
||||
|
||||
@@ -62,6 +62,7 @@ export function replaceInternalLinks(
|
||||
prosemirrorJson: any,
|
||||
slugIdToPath: Record<string, string>,
|
||||
currentPagePath: string,
|
||||
baseUrl?: string,
|
||||
) {
|
||||
const doc = jsonToNode(prosemirrorJson);
|
||||
|
||||
@@ -76,6 +77,10 @@ export function replaceInternalLinks(
|
||||
const localPath = slugIdToPath[slugId];
|
||||
|
||||
if (!localPath) {
|
||||
if (baseUrl && mark.attrs.href.startsWith('/')) {
|
||||
//@ts-expect-error
|
||||
mark.attrs.href = `${baseUrl}${mark.attrs.href}`;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user