Explorar o código

Поправки багов

Book Pauk %!s(int64=6) %!d(string=hai) anos
pai
achega
06d21f4491
Modificáronse 1 ficheiros con 8 adicións e 4 borrados
  1. 8 4
      server/core/BookConverter/sax.js

+ 8 - 4
server/core/BookConverter/sax.js

@@ -47,8 +47,10 @@ function parseSync(xstr, options) {
             }
         }
 
-        const text = xstr.substr(i, left - i);
-        _onTextNode(text, cutCounter, cutTag);
+        if (left != i) {
+            const text = xstr.substr(i, left - i);
+            _onTextNode(text, cutCounter, cutTag);
+        }
 
         let right = null;
         let rightData = null;
@@ -185,8 +187,10 @@ async function parse(xstr, options) {
             }
         }
 
-        const text = xstr.substr(i, left - i);
-        await _onTextNode(text, cutCounter, cutTag);
+        if (left != i) {
+            const text = xstr.substr(i, left - i);
+            await _onTextNode(text, cutCounter, cutTag);
+        }
 
         let right = null;
         let rightData = null;