Оптимизация конвертации по скорости

This commit is contained in:
Book Pauk
2019-01-22 22:22:59 +07:00
parent f2eb0d29af
commit db3ecde741
2 changed files with 8 additions and 11 deletions

View File

@@ -89,7 +89,7 @@ class BookConverter {
growParagraph('<strong>');
break;
case 'div':
const a = getAttr();
var a = getAttr();
if (a && a.align == 'center')
center = true;
break;
@@ -177,7 +177,7 @@ class BookConverter {
});
*/
const charsetAll = chardet.detectAll(data);
const charsetAll = chardet.detectAll(data.slice(0, 10000));
let selected = 'ISO-8859-1';
for (const charset of charsetAll) {