From 8ac5eb9d44cb15547dfdcfc01e46c9ca49b400b9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 16 Apr 2018 23:15:09 -0700 Subject: Markdown reader: remove "fallback" for doubleQuote parser. Previously the parser tried to be efficient -- if no end double quote was found, it would just return the contents. But this could backfire in a case like: **this should "be bold** since the fallback would return the content `"be bold**` and the closing boldface delimiter would never be encountered. --- src/Text/Pandoc/Readers/Markdown.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 71e6f8249..fb42612ca 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -2146,7 +2146,6 @@ singleQuoted = try $ do doubleQuoted :: PandocMonad m => MarkdownParser m (F Inlines) doubleQuoted = try $ do doubleQuoteStart - contents <- mconcat <$> many (try $ notFollowedBy doubleQuoteEnd >> inline) - withQuoteContext InDoubleQuote (doubleQuoteEnd >> return - (fmap B.doubleQuoted . trimInlinesF $ contents)) - <|> return (return (B.str "\8220") <> contents) + withQuoteContext InDoubleQuote $ + fmap B.doubleQuoted . trimInlinesF . mconcat <$> + many1Till inline doubleQuoteEnd -- cgit v1.2.3