Избавился от easysax.js в пользу своего sax.js

This commit is contained in:
Book Pauk
2019-01-27 03:23:14 +07:00
parent 0b0692a331
commit bc1f85208a
4 changed files with 192 additions and 787 deletions

View File

@@ -56,7 +56,7 @@ class BookConverter {
return iconv.decode(data, selected);
}
convertHtml(data, isText) {
async convertHtml(data, isText) {
let titleInfo = {};
let desc = {_n: 'description', 'title-info': titleInfo};
let pars = [];
@@ -123,7 +123,7 @@ class BookConverter {
let buf = this.decode(data).toString();
sax.parse(buf, {
await sax.parse(buf, {
onStartNode, onEndNode, onTextNode,
innerCut: new Set(['head', 'script', 'style'])
});
@@ -321,7 +321,7 @@ class BookConverter {
growParagraph(text);
};
sax.parse(repSpaces(this.decode(data).toString()), {
await sax.parse(repSpaces(this.decode(data).toString()), {
onStartNode, onEndNode, onTextNode, onComment,
innerCut: new Set(['head', 'script', 'style'])
});