Procházet zdrojové kódy

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

Vanessa před 2 roky
rodič
revize
df9b6dc4d5
1 změnil soubory, kde provedl 4 přidání a 3 odebrání
  1. 4 3
      app/src/protyle/toolbar/index.ts

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

@@ -1022,9 +1022,10 @@ export class Toolbar {
                 // 需 div 包裹,否则行内元素会解析错误 https://github.com/siyuan-note/siyuan/issues/6764
                 let html = textElement.value;
                 if (!html.startsWith("<div>\n")) {
-                    html = `<div>
-${html}
-</div>`;
+                    html = `<div>\n${html}`;
+                }
+                if (!html.startsWith("\n</div>")) {
+                    html = `${html}\n</div>`;
                 }
                 renderElement.querySelector("protyle-html").setAttribute("data-content", Lute.EscapeHTMLStr(html));
             } else if (isInlineMemo) {