Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/8554

Vanessafc57da9b3410
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index 319cd00d9d..af1278fce4 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -1348,6 +1348,18 @@ export class WYSIWYG {
// 内容区域使用浏览器原生选区,跨块选择时保留各行内元素自身的选中样式。
if (!startsFromPadding && !tableBlockElement) {
+ documentSelf.onmouseup = () => {
+ documentSelf.onmouseup = null;
+ setTimeout(() => {
+ if (getSelection().rangeCount > 0) {
+ const range = getSelection().getRangeAt(0);
+ if (range.toString().replace(Constants.ZWSP, "") !== "") {
+ protyle.toolbar.render(protyle, range);
+ countSelectWord(range, protyle.block.rootID);
+ }
+ }
+ });
+ };
return;
}
if (startsFromPadding) {