aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-10-11 13:03:57 -0400
committerGitHub <noreply@github.com>2017-10-11 13:03:57 -0400
commitb16e1628d413f2a1ac1748ab78494d60407ecdae (patch)
treee78db3a39d41c93fd3a98f106652c2589f02674b /src/Text
parent18affd488e226bd9e44c6aaac107ae7e59b5ef19 (diff)
parent00013c21eb10dc15b8edad9c0d5ec07622855ba0 (diff)
downloadpandoc-b16e1628d413f2a1ac1748ab78494d60407ecdae.tar.gz
Merge pull request #3965 from labdsf/fb2poem
FB2 Writer: format LineBlock as poem
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/FB2.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/FB2.hs b/src/Text/Pandoc/Writers/FB2.hs
index 736e95636..9cb9098de 100644
--- a/src/Text/Pandoc/Writers/FB2.hs
+++ b/src/Text/Pandoc/Writers/FB2.hs
@@ -56,7 +56,7 @@ import qualified Text.Pandoc.Class as P
import Text.Pandoc.Definition
import Text.Pandoc.Logging
import Text.Pandoc.Options (HTMLMathMethod (..), WriterOptions (..), def)
-import Text.Pandoc.Shared (capitalize, isHeaderBlock, isURI, linesToPara,
+import Text.Pandoc.Shared (capitalize, isHeaderBlock, isURI,
orderedListMarkers)
-- | Data to be written at the end of the document:
@@ -331,7 +331,11 @@ blockToXml b@(RawBlock _ _) = do
return []
blockToXml (Div _ bs) = cMapM blockToXml bs
blockToXml (BlockQuote bs) = (list . el "cite") <$> cMapM blockToXml bs
-blockToXml (LineBlock lns) = blockToXml $ linesToPara lns
+blockToXml (LineBlock lns) =
+ (list . el "poem") <$> mapM stanza (split null lns)
+ where
+ v xs = el "v" <$> cMapM toXml xs
+ stanza xs = el "stanza" <$> mapM v xs
blockToXml (OrderedList a bss) = do
state <- get
let pmrk = parentListMarker state