Работа над BookInfoDialog

This commit is contained in:
Book Pauk
2022-11-11 22:12:13 +07:00
parent a3190e4af3
commit 2dd67487dc
6 changed files with 54 additions and 54 deletions

View File

@@ -239,7 +239,6 @@ class BookInfoDialog {
parseBookInfo() {
const bookInfo = this.bookInfo;
const parser = new Fb2Parser();
//cover
if (bookInfo.cover)
@@ -247,16 +246,10 @@ class BookInfoDialog {
//fb2
if (bookInfo.fb2) {
this.fb2 = parser.bookInfoList(bookInfo.fb2, {
valueToString(value, nodePath, origVTS) {//eslint-disable-line no-unused-vars
if (nodePath == 'documentInfo/historyHtml' && value)
return value.replace(/<p>/g, `<p class="p-history">`);
const parser = new Fb2Parser(bookInfo.fb2);
return origVTS(value, nodePath);
},
});
const infoObj = parser.bookInfo(bookInfo.fb2);
const infoObj = parser.bookInfo();
console.log(JSON.stringify(infoObj, null, 2));
if (infoObj.titleInfo) {
let ann = infoObj.titleInfo.annotationHtml;
if (ann) {
@@ -264,6 +257,15 @@ class BookInfoDialog {
this.annotation = ann;
}
}
this.fb2 = parser.bookInfoList(infoObj, {
valueToString(value, nodePath, origVTS) {//eslint-disable-line no-unused-vars
if (nodePath == 'documentInfo/historyHtml' && value)
return value.replace(/<p>/g, `<p class="p-history">`);
return origVTS(value, nodePath);
},
});
}
//book