aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/Muse.hs6
-rw-r--r--test/Tests/Writers/Muse.hs9
2 files changed, 13 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs
index 6cdd3e182..7a9bc8130 100644
--- a/src/Text/Pandoc/Writers/Muse.hs
+++ b/src/Text/Pandoc/Writers/Muse.hs
@@ -339,8 +339,10 @@ inlineListToMuse :: PandocMonad m
=> [Inline]
-> StateT WriterState m Doc
inlineListToMuse lst = do
- lst' <- preprocessInlineList lst
- hcat <$> mapM inlineToMuse (fixNotes $ normalizeInlineList lst')
+ lst' <- normalizeInlineList <$> preprocessInlineList lst
+ if null lst'
+ then pure "<verbatim></verbatim>"
+ else hcat <$> mapM inlineToMuse (fixNotes lst')
-- | Convert Pandoc inline element to Muse.
inlineToMuse :: PandocMonad m
diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs
index ab5eaa205..68eb9759f 100644
--- a/test/Tests/Writers/Muse.hs
+++ b/test/Tests/Writers/Muse.hs
@@ -101,6 +101,15 @@ tests = [ testGroup "block elements"
, " :: second description"
, " second definition :: third description"
]
+ , "definition list with empty term" =:
+ definitionList [ (text "first definition", [plain $ text "first description"])
+ , (mempty, [plain $ text "second description"])
+ , (str "", [plain $ text "third description"])
+ ]
+ =?> unlines [ " first definition :: first description"
+ , " <verbatim></verbatim> :: second description"
+ , " <verbatim></verbatim> :: third description"
+ ]
]
-- Test that lists of the same type and style are separated with two blanklines
, testGroup "sequential lists"