From 174eb89910b8dc3c762aaf04aa8b4122b0f56331 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 30 Oct 2022 23:03:26 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E5=89=8D=E7=AB=AF=E9=99=90=E5=AE=9A=20?= =?UTF-8?q?window.siyuan.config.editor.blockRefDynamicAnchorTextMaxLen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/editor/rename.ts | 2 +- app/src/protyle/hint/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/editor/rename.ts b/app/src/editor/rename.ts index 55e509f24..49a2bc3c8 100644 --- a/app/src/editor/rename.ts +++ b/app/src/editor/rename.ts @@ -177,6 +177,6 @@ export const newFileBySelect = (fileName: string, protyle: IProtyle) => { title: newName, md: "" }, () => { - insertHTML(genEmptyBlock(false, false, `${escapeHtml(newName)}`), protyle); + insertHTML(genEmptyBlock(false, false, `${escapeHtml(newName.substring(0, window.siyuan.config.editor.blockRefDynamicAnchorTextMaxLen))}`), protyle); }); }; diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts index 5353a7eaf..7cc72cd7e 100644 --- a/app/src/protyle/hint/index.ts +++ b/app/src/protyle/hint/index.ts @@ -421,9 +421,9 @@ ${unicode2Emoji(emoji.unicode, true)}`; markdown: "" }, response => { let tempElement = document.createElement("div"); - let blockRefHTML = `${escapeHtml(realFileName)}`; + let blockRefHTML = `${escapeHtml(realFileName.substring(0, window.siyuan.config.editor.blockRefDynamicAnchorTextMaxLen))}`; if (fileNames.length === 2) { - blockRefHTML = `${escapeHtml(fileNames[0])}`; + blockRefHTML = `${escapeHtml(fileNames[0].substring(0, window.siyuan.config.editor.blockRefDynamicAnchorTextMaxLen))}`; } tempElement.innerHTML = blockRefHTML; tempElement = tempElement.firstElementChild as HTMLDivElement;