Fix image in PDF and filename
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Michel Roux 2022-10-05 23:21:14 +00:00
parent c1203f98fe
commit 19ee4f1eb5

View File

@ -24,6 +24,14 @@ const fetchPage = async (url) => {
content.querySelectorAll('iframe').map((c) => c.remove())
content.querySelectorAll('script').map((c) => c.remove())
content.querySelectorAll('div.tiled-gallery').map((c) => c.remove())
content.querySelectorAll('img').map((c) => {
for (const attr in c.attributes) {
if (attr !== 'src') {
c.removeAttribute(attr)
}
}
})
const data = content.toString()
console.log(title)
@ -62,7 +70,10 @@ const run = async (url, author, lang) => {
const page = await fetchPage(link)
metadatas.content.push(page)
}
const epub = new EPub(metadatas, `output/${title} Volume ${volume}.epub`)
const epub = new EPub(
metadatas,
`output/${title} - Volume ${volume}.epub`
)
await epub.render()
}
}