aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-10-23 03:38:19 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-10-23 03:38:59 +0300
commit4275d58a9f8386ee978c1b20697feb6e0c0c77cc (patch)
tree76afee3b408f68c209408c54ddb64292893c5555
parent1d3460c0b05ad94e412d04ed4891facc3d49deb2 (diff)
downloadpandoc-4275d58a9f8386ee978c1b20697feb6e0c0c77cc.tar.gz
Muse writer: do not insert newline before lists
-rw-r--r--src/Text/Pandoc/Writers/Muse.hs6
-rw-r--r--test/Tests/Writers/Muse.hs1
2 files changed, 4 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs
index 4316ed36c..55d70c170 100644
--- a/src/Text/Pandoc/Writers/Muse.hs
+++ b/src/Text/Pandoc/Writers/Muse.hs
@@ -201,7 +201,7 @@ blockToMuse (OrderedList (start, style, _) items) = do
contents <- zipWithM orderedListItemToMuse markers items
-- ensure that sublists have preceding blank line
topLevel <- asks envTopLevel
- return $ cr $$ (if topLevel then nest 1 else id) (vcat contents) $$ blankline
+ return $ (if topLevel then nest 1 else id) (vcat contents) $$ blankline
where orderedListItemToMuse :: PandocMonad m
=> String -- ^ marker for list item
-> [Block] -- ^ list item (list of blocks)
@@ -212,7 +212,7 @@ blockToMuse (BulletList items) = do
contents <- mapM bulletListItemToMuse items
-- ensure that sublists have preceding blank line
topLevel <- asks envTopLevel
- return $ cr $$ (if topLevel then nest 1 else id) (vcat contents) $$ blankline
+ return $ (if topLevel then nest 1 else id) (vcat contents) $$ blankline
where bulletListItemToMuse :: PandocMonad m
=> [Block]
-> Muse m Doc
@@ -223,7 +223,7 @@ blockToMuse (DefinitionList items) = do
contents <- mapM definitionListItemToMuse items
-- ensure that sublists have preceding blank line
topLevel <- asks envTopLevel
- return $ cr $$ (if topLevel then nest 1 else id) (vcat contents) $$ blankline
+ return $ (if topLevel then nest 1 else id) (vcat contents) $$ blankline
where definitionListItemToMuse :: PandocMonad m
=> ([Inline], [[Block]])
-> Muse m Doc
diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs
index 5a6d9c172..57fbb3e57 100644
--- a/test/Tests/Writers/Muse.hs
+++ b/test/Tests/Writers/Muse.hs
@@ -247,6 +247,7 @@ tests = [ testGroup "block elements"
, " first inner definition :: first inner description"
, " second inner definition :: second inner description"
]
+ , "list item starting with list" =: bulletList [ bulletList [ plain $ text "foo"] ] =?> " - - foo"
]
-- Check that list is intended with one space even inside a quote
, "List inside block quote" =: blockQuote (orderedList [ plain $ text "first"