aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-02-28 14:42:43 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-02-28 14:42:43 +0300
commit8b1630aae029a0c4ce6e6dc881d3e11d0ca7e9ce (patch)
treeef14850f039b8bd44fc0356675336f9d1e2c8840
parent1d57f7a641e9c66d56cab20905a602202336fbad (diff)
downloadpandoc-8b1630aae029a0c4ce6e6dc881d3e11d0ca7e9ce.tar.gz
Muse writer: change verse markup
Use "> " instead of <verse> tag
-rw-r--r--src/Text/Pandoc/Writers/Muse.hs11
-rw-r--r--test/Tests/Writers/Muse.hs8
2 files changed, 5 insertions, 14 deletions
diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs
index 4086bdd9c..314e7a5c1 100644
--- a/src/Text/Pandoc/Writers/Muse.hs
+++ b/src/Text/Pandoc/Writers/Muse.hs
@@ -156,15 +156,8 @@ blockToMuse (Para inlines) = do
contents <- inlineListToMuse inlines
return $ contents <> blankline
blockToMuse (LineBlock lns) = do
- let splitStanza [] = []
- splitStanza xs = case break (== mempty) xs of
- (l, []) -> [l]
- (l, _:r) -> l : splitStanza r
- let joinWithLinefeeds = nowrap . mconcat . intersperse cr
- let joinWithBlankLines = mconcat . intersperse blankline
- let prettyfyStanza ls = joinWithLinefeeds <$> mapM inlineListToMuse ls
- contents <- joinWithBlankLines <$> mapM prettyfyStanza (splitStanza lns)
- return $ blankline $$ "<verse>" $$ contents $$ "</verse>" <> blankline
+ lns' <- mapM inlineListToMuse lns
+ return $ nowrap $ vcat (map ((text "> ") <>) lns') <> blankline
blockToMuse (CodeBlock (_,_,_) str) =
return $ "<example>" $$ text str $$ "</example>" $$ blankline
blockToMuse (RawBlock (Format format) str) =
diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs
index bbf833563..a5a6986f2 100644
--- a/test/Tests/Writers/Muse.hs
+++ b/test/Tests/Writers/Muse.hs
@@ -34,11 +34,9 @@ tests = [ testGroup "block elements"
]
]
, "line block" =: lineBlock [text "Foo", text "bar", text "baz"]
- =?> unlines [ "<verse>"
- , "Foo"
- , "bar"
- , "baz"
- , "</verse>"
+ =?> unlines [ "> Foo"
+ , "> bar"
+ , "> baz"
]
, "code block" =: codeBlock "int main(void) {\n\treturn 0;\n}"
=?> unlines [ "<example>"