|
@@ -231,6 +231,7 @@ class BookConverter {
|
|
let tag = '';// eslint-disable-line no-unused-vars
|
|
let tag = '';// eslint-disable-line no-unused-vars
|
|
|
|
|
|
let inText = false;
|
|
let inText = false;
|
|
|
|
+ let textFound = false;
|
|
let node = {_a: pars};
|
|
let node = {_a: pars};
|
|
|
|
|
|
let inPara = false;
|
|
let inPara = false;
|
|
@@ -374,8 +375,10 @@ class BookConverter {
|
|
};
|
|
};
|
|
|
|
|
|
const onComment = (text) => {// eslint-disable-line no-unused-vars
|
|
const onComment = (text) => {// eslint-disable-line no-unused-vars
|
|
- if (text == '--------- Собственно произведение -------------')
|
|
|
|
|
|
+ if (text == '--------- Собственно произведение -------------') {
|
|
inText = true;
|
|
inText = true;
|
|
|
|
+ textFound = true;
|
|
|
|
+ }
|
|
if (text == '-----------------------------------------------')
|
|
if (text == '-----------------------------------------------')
|
|
inText = false;
|
|
inText = false;
|
|
};
|
|
};
|
|
@@ -418,6 +421,10 @@ class BookConverter {
|
|
innerCut: new Set(['head', 'script', 'style'])
|
|
innerCut: new Set(['head', 'script', 'style'])
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ //текст не найден на странице, обрабатываем как html
|
|
|
|
+ if (!textFound)
|
|
|
|
+ return this.convertHtml(data);
|
|
|
|
+
|
|
const title = (titleInfo['book-title'] ? titleInfo['book-title'] : '');
|
|
const title = (titleInfo['book-title'] ? titleInfo['book-title'] : '');
|
|
let author = '';
|
|
let author = '';
|
|
if (titleInfo.author) {
|
|
if (titleInfo.author) {
|