summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2017-11-01 13:08:15 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2017-11-01 13:08:52 +0300
commit8a5541dca88190e6fdf6ed9ff5c1c5c69c3c9710 (patch)
tree18df4ec58fe62b321eb13712265bc09179c3753e /src
parentd20544dd4f61945d713d26c1ba0c5005fa616b67 (diff)
FB2 writer: remove <annotation> from <body>
<annotation> is not allowed inside <body> according to FictionBook2 XML schema. Besides that, the same information is already placed inside <description>. Related bug: #2424
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/FB2.hs13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/Text/Pandoc/Writers/FB2.hs b/src/Text/Pandoc/Writers/FB2.hs
index 666b67e52..8986c1191 100644
--- a/src/Text/Pandoc/Writers/FB2.hs
+++ b/src/Text/Pandoc/Writers/FB2.hs
@@ -94,9 +94,9 @@ pandocToFB2 :: PandocMonad m
pandocToFB2 opts (Pandoc meta blocks) = do
modify (\s -> s { writerOptions = opts })
desc <- description meta
- fp <- frontpage meta
+ title <- cMapM toXml . docTitle $ meta
secs <- renderSections 1 blocks
- let body = el "body" $ fp ++ secs
+ let body = el "body" $ el "title" (el "p" title) : secs
notes <- renderFootnotes
(imgs,missing) <- fmap imagesToFetch get >>= \s -> lift (fetchImages s)
let body' = replaceImagesWithAlt missing body
@@ -110,15 +110,6 @@ pandocToFB2 opts (Pandoc meta blocks) = do
in [ uattr "xmlns" xmlns
, attr ("xmlns", "l") xlink ]
-frontpage :: PandocMonad m => Meta -> FBM m [Content]
-frontpage meta' = do
- t <- cMapM toXml . docTitle $ meta'
- return
- [ el "title" (el "p" t)
- , el "annotation" (map (el "p" . cMap plain)
- (docAuthors meta' ++ [docDate meta']))
- ]
-
description :: PandocMonad m => Meta -> FBM m Content
description meta' = do
bt <- booktitle meta'