瀏覽代碼

:sparkles: https://github.com/siyuan-note/siyuan/issues/2911 file-annotation-ref

Vanessa 2 年之前
父節點
當前提交
fbe8c2347f
共有 2 個文件被更改,包括 3 次插入5 次删除
  1. 1 1
      app/src/assets/scss/_wysiwyg.scss
  2. 2 4
      app/src/protyle/toolbar/index.ts

+ 1 - 1
app/src/assets/scss/_wysiwyg.scss

@@ -246,7 +246,7 @@
       transition: var(--b3-transition);
     }
 
-    span[data-type="file-annotation-ref"]:before {
+    span[data-type~="file-annotation-ref"]:before {
       content: "🔖 ";
     }
 

+ 2 - 4
app/src/protyle/toolbar/index.ts

@@ -126,7 +126,7 @@ export class Toolbar {
         });
         const types = this.getCurrentType();
         types.forEach(item => {
-            if (item === "block-ref" || item === "text") {
+            if (item === "block-ref" || item === "text" || item === "file-annotation-ref") {
                 return;
             }
             this.element.querySelector(`[data-type="${item}"]`).classList.add("protyle-toolbar__item--current");
@@ -725,9 +725,7 @@ export class Toolbar {
             focusByWbr(nodeElement, this.range);
         });
         const anchorElement = this.subElement.querySelector('[data-type="anchor"]') as HTMLInputElement;
-        if (refElement.getAttribute("data-subtype") === "s") {
-            anchorElement.value = refElement.textContent;
-        }
+        anchorElement.value = refElement.textContent;
         anchorElement.addEventListener("change", (event) => {
             refElement.after(document.createElement("wbr"));
             nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));