aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2017-11-24 13:16:09 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2017-11-24 13:16:09 +0300
commit137c7c2a657492c4652d1ebcaceea44ff69f262b (patch)
tree5ef6046df3329432ce6c727d10008b88da042788
parentfe7443654006e1b461aa480445c3ef58fa942b07 (diff)
downloadpandoc-137c7c2a657492c4652d1ebcaceea44ff69f262b.tar.gz
Muse reader: allow definition to end with EOF
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs2
-rw-r--r--test/Tests/Readers/Muse.hs2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index a3cb40e58..6599ba059 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -445,7 +445,7 @@ definitionListItem = try $ do
term <- termParser
many1 spaceChar
string "::"
- firstLine <- anyLineNewline
+ firstLine <- many $ noneOf "\n"
restLines <- manyTill anyLineNewline endOfListItemElement
let lns = firstLine : restLines
lineContent <- parseFromString (withListContext parseBlocks) $ concat lns ++ "\n"
diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs
index 3e4b89207..3d5ad1fb9 100644
--- a/test/Tests/Readers/Muse.hs
+++ b/test/Tests/Readers/Muse.hs
@@ -754,6 +754,8 @@ tests =
] =?>
para "Foo" <>
definitionList [ ("Bar", [ para "baz" ]) ]
+ , "One-line definition list" =: " foo :: bar" =?>
+ definitionList [ ("foo", [ para "bar" ]) ]
, "Multi-line definition lists" =:
T.unlines
[ " First term :: Definition of first term"