浏览代码

Поправки

Book Pauk 6 年之前
父节点
当前提交
fdac4729a7
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      server/core/BookConverter/index.js

+ 3 - 2
server/core/BookConverter/index.js

@@ -259,12 +259,13 @@ class BookConverter {
         };
         };
 
 
         const closeTag = (name) => {
         const closeTag = (name) => {
-            if (node._n == name && node._p)
+            if (node._n == name && node._p) {
                 node = node._p;
                 node = node._p;
+            }
         };
         };
 
 
         const growParagraph = (text) => {
         const growParagraph = (text) => {
-            if (node._a.length == 0)
+            if (node._n == 'p' && node._a.length == 0)
                 text = text.trimLeft();
                 text = text.trimLeft();
             node._a.push({_t: text});
             node._a.push({_t: text});
         };
         };