浏览代码

Доработки

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

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

@@ -179,8 +179,6 @@ class BookConverter {
                 const growPar = (text) => {
                     const l = newPars.length;
                     if (l) {
-                        if (newPars[l - 1]._t == '')
-                            text = text.trimLeft();
                         newPars[l - 1]._t += text;
                     }
                 }
@@ -209,6 +207,10 @@ class BookConverter {
             body.section._a[0] = pars;
         }
 
+        //убрать лишнее
+        for (let p of body.section._a[0]) {
+            p._t = p._t.replace(/[\t\n\r]/g, ' ');
+        }
 
         return this.formatFb2(fb2);
     }