diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2018-02-23 22:07:30 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2018-02-23 22:07:53 +0300 |
commit | 8f8f0f8a603a75ea56068f65ef6e13c2c66a8402 (patch) | |
tree | 4cf257649c37c50ce22a3894267d5953ca5fc624 | |
parent | 788cb6e9a19d575666436197e77e8e17679753ed (diff) | |
download | pandoc-8f8f0f8a603a75ea56068f65ef6e13c2c66a8402.tar.gz |
Muse writer: don't indent nested definition lists
-rw-r--r-- | src/Text/Pandoc/Writers/Muse.hs | 4 | ||||
-rw-r--r-- | test/Tests/Writers/Muse.hs | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs index 7f53e202d..b4eb19ef6 100644 --- a/src/Text/Pandoc/Writers/Muse.hs +++ b/src/Text/Pandoc/Writers/Muse.hs @@ -207,7 +207,9 @@ blockToMuse (BulletList items) = do return $ hang 2 "- " contents blockToMuse (DefinitionList items) = do contents <- mapM definitionListItemToMuse items - return $ cr $$ nest 1 (vcat contents) $$ blankline + -- ensure that sublists have preceding blank line + topLevel <- gets stTopLevel + return $ cr $$ (if topLevel then nest 1 else id) (vcat contents) $$ blankline where definitionListItemToMuse :: PandocMonad m => ([Inline], [[Block]]) -> StateT WriterState m Doc diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs index 13c457a37..7aee36217 100644 --- a/test/Tests/Writers/Muse.hs +++ b/test/Tests/Writers/Muse.hs @@ -217,8 +217,8 @@ tests = [ testGroup "block elements" ] =?> unlines [ " first definition :: first description" , " second definition :: second description" - , " first inner definition :: first inner description" - , " second inner definition :: second inner description" + , " first inner definition :: first inner description" + , " second inner definition :: second inner description" ] ] -- Check that list is intended with one space even inside a quote |