diff options
author | mb21 <mb21@users.noreply.github.com> | 2018-10-21 13:48:38 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-10-28 16:18:11 -0700 |
commit | 7e6f13cf81d8233d18db68e263d01d620dcf0350 (patch) | |
tree | b3f2c6cc36e7eccd340e00869e2ceb2c7c92d5f2 /src/Text/Pandoc/Writers | |
parent | 8ef995cfc0f9f53444fedf517c05fe02cb6311e7 (diff) | |
download | pandoc-7e6f13cf81d8233d18db68e263d01d620dcf0350.tar.gz |
EPUB writer: use metadata field `css` instead of `stylesheet`
closes #4990
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r-- | src/Text/Pandoc/Writers/EPUB.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index 6099f0223..96b8c88ed 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -36,6 +36,7 @@ module Text.Pandoc.Writers.EPUB ( writeEPUB2, writeEPUB3 ) where import Prelude import Codec.Archive.Zip (Entry, addEntryToArchive, eRelativePath, emptyArchive, fromArchive, fromEntry, toEntry) +import Control.Applicative ( (<|>) ) import Control.Monad (mplus, unless, when, zipWithM) import Control.Monad.Except (catchError, throwError) import Control.Monad.State.Strict (State, StateT, evalState, evalStateT, get, @@ -351,9 +352,9 @@ metadataFromMeta opts meta = EPUBMetadata{ rights = metaValueToString <$> lookupMeta "rights" meta coverImage = lookup "epub-cover-image" (writerVariables opts) `mplus` (metaValueToString <$> lookupMeta "cover-image" meta) - stylesheets = fromMaybe [] - (metaValueToPaths <$> lookupMeta "stylesheet" meta) ++ - [f | ("css",f) <- writerVariables opts] + mCss = lookupMeta "css" meta <|> lookupMeta "stylesheet" meta + stylesheets = fromMaybe [] (metaValueToPaths <$> mCss) ++ + [f | ("css",f) <- writerVariables opts] pageDirection = case map toLower . metaValueToString <$> lookupMeta "page-progression-direction" meta of Just "ltr" -> Just LTR |