diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2018-04-19 17:03:21 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2018-04-19 17:03:21 +0300 |
commit | caeb963447440edb14a67bb02cb6c956232dce63 (patch) | |
tree | 20c8c373aa3b09912f722255d8f4efc935d89fb5 /src | |
parent | ce4326a4f12180844532febf93261f098cd6c5aa (diff) | |
download | pandoc-caeb963447440edb14a67bb02cb6c956232dce63.tar.gz |
FB2 writer: convert metadata value "abstract" to book annotation
Diffstat (limited to 'src')
-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 f0d2cc3af..e1fa7f474 100644 --- a/src/Text/Pandoc/Writers/FB2.hs +++ b/src/Text/Pandoc/Writers/FB2.hs @@ -118,6 +118,9 @@ description meta' = do bt <- booktitle meta' let as = authors meta' dd <- docdate meta' + annotation <- case lookupMeta "abstract" meta' of + Just (MetaBlocks bs) -> (list . el "annotation") <$> cMapM blockToXml bs + _ -> pure mempty let lang = case lookupMeta "lang" meta' of Just (MetaInlines [Str s]) -> [el "lang" $ iso639 s] Just (MetaString s) -> [el "lang" $ iso639 s] @@ -132,7 +135,7 @@ description meta' = do Just (MetaString s) -> coverimage s _ -> return [] return $ el "description" - [ el "title-info" (genre : (bt ++ as ++ dd ++ lang)) + [ el "title-info" (genre : (bt ++ annotation ++ as ++ dd ++ lang)) , el "document-info" (el "program-used" "pandoc" : coverpage) ] |