From d33f0d4782aa403abdbe9eb78576fce0c04db6f4 Mon Sep 17 00:00:00 2001 From: daniel-j Date: Mon, 26 Mar 2018 21:48:28 +0200 Subject: [PATCH] kepubify fix and tag fix --- src/kepubify.js | 2 +- src/style/titlestyle.styl | 8 +++++++- src/templates.js | 16 ++++++---------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/kepubify.js b/src/kepubify.js index d595a9f..3244bbe 100644 --- a/src/kepubify.js +++ b/src/kepubify.js @@ -55,7 +55,7 @@ function textToSpans (node, text, state) { const span = createSpan(state.paragraph, state.segment++) span.text = sentence return span - }).filter(el => el) + }) } function addSpansToNode (node, parent, state) { diff --git a/src/style/titlestyle.styl b/src/style/titlestyle.styl index 2682e6f..5ddb502 100644 --- a/src/style/titlestyle.styl +++ b/src/style/titlestyle.styl @@ -45,6 +45,7 @@ border-radius: 4px; font-size: .8125rem; vertical-align: 4px; + margin-right: 0.4em; margin-right: .3125rem; font-family: sans-serif; @@ -73,9 +74,14 @@ margin-bottom: 0.6em; text-align: left !important; font-size: 0.8em; + .tagbox { + display: inline-block; + padding-right: 5px; + padding-right: 0.3em; + } } .story-tag { - display: inline-block; + display: inline; padding: 0.3em 0.5em; margin-bottom: 0.3em; line-height: 1.0em; diff --git a/src/templates.js b/src/templates.js index f48bf44..7171b02 100644 --- a/src/templates.js +++ b/src/templates.js @@ -439,11 +439,9 @@ export function createTitlePage (ffc) { m('section.author', ['by ', m('b', ffc.storyInfo.author.name)]) ]), // m('hr'), - m('section.tags', [ - ffc.tags.filter((tag) => tag.type !== 'character').map((tag) => - [m('div', {className: tag.className}, tag.name), ' '] - ) - ]), + m('section.tags', ffc.tags.filter((tag) => tag.type !== 'character').map((tag) => + [m('span.tagbox', m('span', {className: tag.className}, tag.name))] + )), m('.readlink', m('a', {href: ffc.storyInfo.url}, 'Story on Fimfiction')), // m('hr'), ffc.storyInfo.prequel ? [m('div', [ @@ -464,11 +462,9 @@ export function createTitlePage (ffc) { ffc.options.calculateReadingEase && ffc.readingEase ? infoBox('Reading Ease', (Math.round(ffc.readingEase.ease * 100) / 100).toLocaleString('en-GB')) : null ]), // m('hr'), - m('section.tags', [ - ffc.tags.filter((tag) => tag.type === 'character').map((tag) => - [m('div', {className: tag.className}, tag.name), ' '] - ) - ]) + m('section.tags', ffc.tags.filter((tag) => tag.type === 'character').map((tag) => + [m('span.tagbox', m('span', {className: tag.className}, tag.name))] + )) ])) ]) , {strict: true}).then((titlePage) => {