From 888e71e39e8348bfeaec4dc6da796c30721e0f41 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 23 Mar 2025 13:40:22 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/14421 --- app/src/protyle/toolbar/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts index 38d716cf0..bc1184f15 100644 --- a/app/src/protyle/toolbar/index.ts +++ b/app/src/protyle/toolbar/index.ts @@ -327,7 +327,7 @@ export class Toolbar { // 遇到以下类型结尾不应继承 https://github.com/siyuan-note/siyuan/issues/7200 let removeIndex = 0; while (removeIndex < rangeTypes.length) { - if (["inline-memo", "text", "block-ref", "file-annotation-ref", "a"].includes(rangeTypes[removeIndex])) { + if (["inline-memo", "text", "block-ref", "virtual-block-ref", "file-annotation-ref", "a"].includes(rangeTypes[removeIndex])) { rangeTypes.splice(removeIndex, 1); } else { ++removeIndex; @@ -422,12 +422,16 @@ export class Toolbar { if (isEndSpan) { let removeIndex = 0; while (removeIndex < rangeTypes.length) { - if (["inline-memo", "text", "block-ref", "file-annotation-ref", "a"].includes(rangeTypes[removeIndex])) { + if (["inline-memo", "text", "block-ref", "virtual-block-ref", "file-annotation-ref", "a"].includes(rangeTypes[removeIndex])) { rangeTypes.splice(removeIndex, 1); } else { ++removeIndex; } } + // https://github.com/siyuan-note/siyuan/issues/14421 + if (rangeTypes.length === 0) { + rangeTypes.push(type); + } } inlineElement.setAttribute("data-type", [...new Set(rangeTypes)].join(" ")); inlineElement.textContent = Constants.ZWSP;