From 2c39ef890ad7f54711d28135a4671a24d6f3ccda Mon Sep 17 00:00:00 2001 From: Niklas Gollenstede Date: Mon, 21 Jan 2019 00:01:03 +0100 Subject: [PATCH] fix inline style collection (#4) --- README.md | 3 ++- common/options.js | 3 ++- content/collect/overdrive.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c48d6e2..4877ebe 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ # ePub Creator -- create ePubs from web pages and `overdrive.com`s online reader + ePub creator allows you to save web pages opened in the browser as offline ePub e-books. It currently supports: Instructions: diff --git a/common/options.js b/common/options.js index 76500e2..63d3db9 100644 --- a/common/options.js +++ b/common/options.js @@ -12,7 +12,8 @@ const model = { }, collectStyles: { title: `Keep style information`, - description: `If enabled, some style information are extracted. Some readers won't be able to change the font size when styles are set.`, + description: `If enabled, some style information are extracted, but some readers won't be able to change the font settings when styles are set. + Only applies to overdrive.com, reader mode always removes all styles.`, default: false, input: { type: 'boolean', }, }, diff --git a/content/collect/overdrive.js b/content/collect/overdrive.js index e2c5c25..48591e8 100644 --- a/content/collect/overdrive.js +++ b/content/collect/overdrive.js @@ -57,7 +57,7 @@ const chapters = (await Promise.all(bData.spine.map(async ({ .underline { text-decoration: underline; } .bold { font-weight: bold; } ` ); - options.styles && (css += Array.from(styles, ([ index, style, ]) => `\t\t.inline-${index} { ${style} }\n`).join('')); + options.styles && (css += Array.from(styles, ([ style, index, ]) => `\t\t.inline-${index} { ${style} }\n`).join('')); // html clean-up document.documentElement.setAttribute('xmlns', "http://www.w3.org/1999/xhtml");