git.iko.soy/typeable/pandoc
on master help sign in
Muse reader: allow single colon in definition list term
39dd7c7Alexander Krotov
src/Text/Pandoc/Readers/Muse.hs+1−1
@@ -625,7 +625,7 @@ definitionListItemsUntil indent end =
625 where
625 where
626 continuation = try $ do
626 continuation = try $ do
627 pos <- getPosition
627 pos <- getPosition
628− term <- trimInlinesF . mconcat <$> manyTill (choice inlineList) (string "::")
628+ term <- trimInlinesF . mconcat <$> manyTill (choice inlineList) (try $ string "::")
629 (x, e) <- descriptionsUntil (sourceColumn pos) ((Right <$> try (optional blankline >> indentWith indent >> continuation)) <|> (Left <$> end))
629 (x, e) <- descriptionsUntil (sourceColumn pos) ((Right <$> try (optional blankline >> indentWith indent >> continuation)) <|> (Left <$> end))
630 let xx = do
630 let xx = do
631 term' <- term
631 term' <- term
test/Tests/Readers/Muse.hs+3
@@ -1073,6 +1073,9 @@ tests =
1073 definitionList [ ("Bar", [ para "baz" ]) ]
1073 definitionList [ ("Bar", [ para "baz" ]) ]
1074 , "One-line definition list" =: " foo :: bar" =?>
1074 , "One-line definition list" =: " foo :: bar" =?>
1075 definitionList [ ("foo", [ para "bar" ]) ]
1075 definitionList [ ("foo", [ para "bar" ]) ]
1076+ , "Definition list term may include single colon" =:
1077+ " foo:bar :: baz" =?>
1078+ definitionList [ ("foo:bar", [ para "baz" ]) ]
1076 , "Definition list term with emphasis" =: " *Foo* :: bar\n" =?>
1079 , "Definition list term with emphasis" =: " *Foo* :: bar\n" =?>
1077 definitionList [ (emph "Foo", [ para "bar" ]) ]
1080 definitionList [ (emph "Foo", [ para "bar" ]) ]
1078 , "Definition list term with :: inside code" =: " foo <code> :: </code> :: bar <code> :: </code> baz\n" =?>
1081 , "Definition list term with :: inside code" =: " foo <code> :: </code> :: bar <code> :: </code> baz\n" =?>