Muse reader: allow single colon in definition list term

This commit is contained in:
Alexander Krotov 2018-02-24 02:37:35 +03:00
parent 6de2c0710f
commit 39dd7c794b
2 changed files with 4 additions and 1 deletions

View file

@ -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

View file

@ -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 <code> :: </code> :: bar <code> :: </code> baz\n" =?>