aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/FB2.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/FB2.hs b/src/Text/Pandoc/Writers/FB2.hs
index bac3121d9..3227aaed8 100644
--- a/src/Text/Pandoc/Writers/FB2.hs
+++ b/src/Text/Pandoc/Writers/FB2.hs
@@ -119,7 +119,7 @@ description meta' = do
let as = authors meta'
dd <- docdate meta'
annotation <- case lookupMeta "abstract" meta' of
- Just (MetaBlocks bs) -> (list . el "annotation") <$> cMapM blockToXml bs
+ Just (MetaBlocks bs) -> (list . el "annotation") <$> (cMapM blockToXml $ map unPlain bs)
_ -> pure mempty
let lang = case lookupMeta "lang" meta' of
Just (MetaInlines [Str s]) -> [el "lang" $ iso639 s]
@@ -398,6 +398,11 @@ plainToPara (Para inlines : rest) =
Para inlines : HorizontalRule : plainToPara rest -- HorizontalRule will be converted to <empty-line />
plainToPara (p:rest) = p : plainToPara rest
+-- Replace plain text with paragraphs
+unPlain :: Block -> Block
+unPlain (Plain inlines) = Para inlines
+unPlain x = x
+
-- Simulate increased indentation level. Will not really work
-- for multi-line paragraphs.
indentPrefix :: String -> Block -> Block