mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
FB2 improvements
- Set title text-align more specifically on h1 - Don't throw when there's no cover
This commit is contained in:
@@ -168,14 +168,16 @@ body > img, section > img {
|
|||||||
display: block;
|
display: block;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
.title {
|
.title h1 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
body > section > .title, body.notesBodyType > .title {
|
body > section > .title, body.notesBodyType > .title {
|
||||||
margin: 3em 0;
|
margin: 3em 0;
|
||||||
}
|
}
|
||||||
|
body.notesBodyType > section .title h1 {
|
||||||
|
text-align: start;
|
||||||
|
}
|
||||||
body.notesBodyType > section .title {
|
body.notesBodyType > section .title {
|
||||||
text-align: left;
|
|
||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
}
|
}
|
||||||
p {
|
p {
|
||||||
@@ -255,8 +257,10 @@ export const makeFB2 = async blob => {
|
|||||||
{ annotation: ['div', SECTION] }).innerHTML : null,
|
{ annotation: ['div', SECTION] }).innerHTML : null,
|
||||||
subject: $$('title-info genre').map(getElementText),
|
subject: $$('title-info genre').map(getElementText),
|
||||||
}
|
}
|
||||||
book.getCover = () => fetch(getImageSrc($('coverpage image')))
|
if ($('coverpage image')) {
|
||||||
.then(res => res.blob())
|
const src = getImageSrc($('coverpage image'))
|
||||||
|
book.getCover = () => fetch(src).then(res => res.blob())
|
||||||
|
} else book.getCover = () => null
|
||||||
|
|
||||||
// get convert each body
|
// get convert each body
|
||||||
const bodyData = Array.from(doc.querySelectorAll('body'), body => {
|
const bodyData = Array.from(doc.querySelectorAll('body'), body => {
|
||||||
|
|||||||
Reference in New Issue
Block a user