diff options
author | John <46772462+KetzerX@users.noreply.github.com> | 2019-05-04 18:56:00 +0300 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-05-04 11:56:00 -0400 |
commit | 2fa8c0dc96bd79c8688cb621e330f325589847a6 (patch) | |
tree | 4c0edb4530f78a9fc00a47e103db3b156016654b /src/Text/Pandoc | |
parent | 9dd2eefded7879df85150484c0476410dd77a4f7 (diff) | |
download | pandoc-2fa8c0dc96bd79c8688cb621e330f325589847a6.tar.gz |
FB2 writer: use genre metadata field (#5478)
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/FB2.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/FB2.hs b/src/Text/Pandoc/Writers/FB2.hs index 7b028ffbf..9852922ae 100644 --- a/src/Text/Pandoc/Writers/FB2.hs +++ b/src/Text/Pandoc/Writers/FB2.hs @@ -40,6 +40,7 @@ import Text.Pandoc.Definition import Text.Pandoc.Logging import Text.Pandoc.Options (HTMLMathMethod (..), WriterOptions (..), def) import Text.Pandoc.Shared (capitalize, isURI, orderedListMarkers, hierarchicalize) +import Text.Pandoc.Writers.Shared (lookupMetaString) import qualified Text.Pandoc.Shared as Shared (Element(Blk, Sec)) -- | Data to be written at the end of the document: @@ -96,7 +97,9 @@ pandocToFB2 opts (Pandoc meta blocks) = do description :: PandocMonad m => Meta -> FBM m Content description meta' = do - let genre = el "genre" "unrecognised" + let genre = case lookupMetaString "genre" meta' of + "" -> el "genre" "unrecognised" + s -> el "genre" s bt <- booktitle meta' let as = authors meta' dd <- docdate meta' |