mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-05 16:28:49 +01:00
🎨 前端限定 window.siyuan.config.editor.blockRefDynamicAnchorTextMaxLen
This commit is contained in:
parent
998665a171
commit
174eb89910
2 changed files with 3 additions and 3 deletions
|
|
@ -177,6 +177,6 @@ export const newFileBySelect = (fileName: string, protyle: IProtyle) => {
|
|||
title: newName,
|
||||
md: ""
|
||||
}, () => {
|
||||
insertHTML(genEmptyBlock(false, false, `<span data-type="block-ref" data-id="${id}" data-subtype="d">${escapeHtml(newName)}</span>`), protyle);
|
||||
insertHTML(genEmptyBlock(false, false, `<span data-type="block-ref" data-id="${id}" data-subtype="d">${escapeHtml(newName.substring(0, window.siyuan.config.editor.blockRefDynamicAnchorTextMaxLen))}</span>`), protyle);
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -421,9 +421,9 @@ ${unicode2Emoji(emoji.unicode, true)}</button>`;
|
|||
markdown: ""
|
||||
}, response => {
|
||||
let tempElement = document.createElement("div");
|
||||
let blockRefHTML = `<span data-type="block-ref" data-id="${response.data}" data-subtype="d">${escapeHtml(realFileName)}</span>`;
|
||||
let blockRefHTML = `<span data-type="block-ref" data-id="${response.data}" data-subtype="d">${escapeHtml(realFileName.substring(0, window.siyuan.config.editor.blockRefDynamicAnchorTextMaxLen))}</span>`;
|
||||
if (fileNames.length === 2) {
|
||||
blockRefHTML = `<span data-type="block-ref" data-id="${response.data}" data-subtype="s">${escapeHtml(fileNames[0])}</span>`;
|
||||
blockRefHTML = `<span data-type="block-ref" data-id="${response.data}" data-subtype="s">${escapeHtml(fileNames[0].substring(0, window.siyuan.config.editor.blockRefDynamicAnchorTextMaxLen))}</span>`;
|
||||
}
|
||||
tempElement.innerHTML = blockRefHTML;
|
||||
tempElement = tempElement.firstElementChild as HTMLDivElement;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue