🎨 Copy block hyperlink (Markdown) anchor text length follows editor setting The maximum length of block ref dynamic anchor text Fix https://github.com/siyuan-note/siyuan/issues/8144

This commit is contained in:
Liang Ding 2023-05-03 14:35:07 +08:00
parent 72fc754b34
commit e4ea1a7824
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -473,7 +473,7 @@ export const copySubMenu = (id: string, accelerator = true, focusElement?: Eleme
label: window.siyuan.languages.copyProtocolInMd, label: window.siyuan.languages.copyProtocolInMd,
click: () => { click: () => {
fetchPost("/api/block/getRefText", {id}, (response) => { fetchPost("/api/block/getRefText", {id}, (response) => {
writeText(`[${response.data.substring(0, Constants.SIZE_LINK_TEXT_MAX)}](siyuan://blocks/${id})`); writeText(`[${response.data}](siyuan://blocks/${id})`);
}); });
if (focusElement) { if (focusElement) {
focusBlock(focusElement); focusBlock(focusElement);