aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/FB2.hs
diff options
context:
space:
mode:
authorJohn <46772462+KetzerX@users.noreply.github.com>2019-05-04 18:56:00 +0300
committerJohn MacFarlane <jgm@berkeley.edu>2019-05-04 11:56:00 -0400
commit2fa8c0dc96bd79c8688cb621e330f325589847a6 (patch)
tree4c0edb4530f78a9fc00a47e103db3b156016654b /src/Text/Pandoc/Writers/FB2.hs
parent9dd2eefded7879df85150484c0476410dd77a4f7 (diff)
downloadpandoc-2fa8c0dc96bd79c8688cb621e330f325589847a6.tar.gz
FB2 writer: use genre metadata field (#5478)
Diffstat (limited to 'src/Text/Pandoc/Writers/FB2.hs')
-rw-r--r--src/Text/Pandoc/Writers/FB2.hs5
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'