Przeglądaj źródła

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

Vanessa 10 miesięcy temu
rodzic
commit
4ccf648e57
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      app/src/protyle/wysiwyg/index.ts

+ 3 - 2
app/src/protyle/wysiwyg/index.ts

@@ -382,8 +382,9 @@ export class WYSIWYG {
                         html = tempElement.innerHTML;
                     }
                     // 不能使用 commonAncestorContainer https://ld246.com/article/1643282894693
-                    if (hasClosestByAttribute(range.startContainer, "data-type", "NodeCodeBlock") ||
-                        hasClosestByMatchTag(range.startContainer, "CODE")) {
+                    if (hasClosestByAttribute(range.startContainer, "data-type", "NodeCodeBlock")) {
+                        textPlain = tempElement.textContent.replace(Constants.ZWSP, "").replace(/\n$/, "");
+                    } else if (hasClosestByMatchTag(range.startContainer, "CODE")) {
                         textPlain = tempElement.textContent.replace(Constants.ZWSP, "");
                     }
                 }