From 39dd7c794bc881acd2030c07ddfb7b34842f19a3 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Sat, 24 Feb 2018 02:37:35 +0300 Subject: [PATCH] Muse reader: allow single colon in definition list term --- src/Text/Pandoc/Readers/Muse.hs | 2 +- test/Tests/Readers/Muse.hs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index 1fb37aa16..26da57883 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -625,7 +625,7 @@ definitionListItemsUntil indent end = where continuation = try $ do pos <- getPosition - term <- trimInlinesF . mconcat <$> manyTill (choice inlineList) (string "::") + term <- trimInlinesF . mconcat <$> manyTill (choice inlineList) (try $ string "::") (x, e) <- descriptionsUntil (sourceColumn pos) ((Right <$> try (optional blankline >> indentWith indent >> continuation)) <|> (Left <$> end)) let xx = do term' <- term diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index c0ebf33cc..d951fca49 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -1073,6 +1073,9 @@ tests = definitionList [ ("Bar", [ para "baz" ]) ] , "One-line definition list" =: " foo :: bar" =?> definitionList [ ("foo", [ para "bar" ]) ] + , "Definition list term may include single colon" =: + " foo:bar :: baz" =?> + definitionList [ ("foo:bar", [ para "baz" ]) ] , "Definition list term with emphasis" =: " *Foo* :: bar\n" =?> definitionList [ (emph "Foo", [ para "bar" ]) ] , "Definition list term with :: inside code" =: " foo :: :: bar :: baz\n" =?>