aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs8
-rw-r--r--test/Tests/Readers/Muse.hs18
2 files changed, 22 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index 3e642b386..293bc627c 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -265,10 +265,10 @@ parseBlocksTill :: PandocMonad m
=> MuseParser m a
-> MuseParser m (F Blocks)
parseBlocksTill end =
- try parseEnd <|>
- try blockStart <|>
- try listStart <|>
- try paraStart
+ try (parseEnd <|>
+ blockStart <|>
+ listStart <|>
+ paraStart)
where
parseEnd = mempty <$ end
blockStart = do first <- blockElements
diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs
index 01e8d7b85..f64927ff1 100644
--- a/test/Tests/Readers/Muse.hs
+++ b/test/Tests/Readers/Muse.hs
@@ -1224,5 +1224,23 @@ tests =
, "</quote>"
] =?>
blockQuote (bulletList [ blockQuote $ para "foo" ] <> para "bar")
+
+ , "Unclosed quote tag" =:
+ T.unlines
+ [ "<quote>"
+ , "<verse>"
+ , "</quote>"
+ , "</verse>"
+ ] =?>
+ para "<quote>" <> lineBlock [ "</quote>" ]
+
+ , "Unclosed quote tag inside list" =:
+ T.unlines
+ [ " - <quote>"
+ , " <verse>"
+ , " </quote>"
+ , " </verse>"
+ ] =?>
+ bulletList [ para "<quote>" <> lineBlock [ "</quote>" ] ]
]
]