浏览代码

:art: fix https://github.com/siyuan-note/siyuan/issues/6031

Vanessa 2 年之前
父节点
当前提交
5853a077fd
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      app/src/protyle/wysiwyg/index.ts

+ 5 - 0
app/src/protyle/wysiwyg/index.ts

@@ -251,6 +251,11 @@ export class WYSIWYG {
                     for (let i = 0; i < attributes.length; i++) {
                         spanElement.setAttribute(attributes[i].name, attributes[i].value);
                     }
+                    if (spanElement.getAttribute("data-type").indexOf("block-ref") > -1 &&
+                        spanElement.getAttribute("data-subtype") === "d") {
+                        // 需变为静态锚文本
+                        spanElement.setAttribute("data-subtype", "s");
+                    }
                     spanElement.textContent = range.toString();
                     html = spanElement.outerHTML;
                 } else {