aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs3
-rw-r--r--test/Tests/Readers/Muse.hs2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index 04cec149b..46dcf38d9 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -220,8 +220,7 @@ blockElements = choice [ comment
comment :: PandocMonad m => MuseParser m (F Blocks)
comment = try $ do
char ';'
- space
- many $ noneOf "\n"
+ optionMaybe (spaceChar >> (many $ noneOf "\n"))
eol
return mempty
diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs
index 28db0191b..41d1d9710 100644
--- a/test/Tests/Readers/Muse.hs
+++ b/test/Tests/Readers/Muse.hs
@@ -421,6 +421,8 @@ tests =
, testGroup "Comments"
[ "Comment tag" =: "<comment>\nThis is a comment\n</comment>" =?> (mempty::Blocks)
, "Line comment" =: "; Comment" =?> (mempty::Blocks)
+ , "Empty comment" =: ";" =?> (mempty::Blocks)
+ , "Text after empty comment" =: ";\nfoo" =?> para "foo" -- Make sure we don't consume newline while looking for whitespace
, "Not a comment (does not start with a semicolon)" =: " ; Not a comment" =?> para (text "; Not a comment")
, "Not a comment (has no space after semicolon)" =: ";Not a comment" =?> para (text ";Not a comment")
]