Browse Source

:bug: fix https://github.com/siyuan-note/siyuan/issues/6398

Vanessa 2 years ago
parent
commit
6104ba3035
1 changed files with 6 additions and 0 deletions
  1. 6 0
      app/src/menus/commonMenuItem.ts

+ 6 - 0
app/src/menus/commonMenuItem.ts

@@ -325,6 +325,12 @@ export const openFileAttr = (attrs: IObject, id: string, focusName = "bookmark")
                 item.editor.protyle.title.element.querySelector(".protyle-attr").innerHTML = nodeAttrHTML;
                 item.editor.protyle.wysiwyg.renderCustom(attrsResult);
             }
+            // https://github.com/siyuan-note/siyuan/issues/6398
+            item.editor.protyle.wysiwyg.element.querySelectorAll(`[data-type~="block-ref"][data-id="${id}"][data-subtype="d"]`).forEach(item => {
+                fetchPost("/api/block/getRefText", {id: id}, (response) => {
+                    item.innerHTML = response.data;
+                });
+            });
         });
         /// #endif
         fetchPost("/api/attr/resetBlockAttrs", {id, attrs: attrsResult}, () => {