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;