diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 8a273ffb0..17644add4 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -2396,7 +2396,12 @@ export class WYSIWYG { setTimeout(() => { // 选中后,在选中的文字上点击需等待 range 更新 - const newRange = getEditorRange(this.element); + let newRange = getEditorRange(this.element); + // https://github.com/siyuan-note/siyuan/issues/10357 + const attrElement = hasClosestByClassName(newRange.endContainer, "protyle-attr") + if (attrElement) { + newRange = setLastNodeRange(attrElement.previousElementSibling, newRange, false); + } /// #if !MOBILE if (newRange.toString().replace(Constants.ZWSP, "") !== "") { protyle.toolbar.render(protyle, newRange);