diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-04-16 23:15:09 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-04-16 23:15:09 -0700 |
commit | 8ac5eb9d44cb15547dfdcfc01e46c9ca49b400b9 (patch) | |
tree | 007d3a368fafb508be30ae692c4408ddfc759cf7 | |
parent | 57256d6d91669d1a0256132cd9336364656eb924 (diff) | |
download | pandoc-8ac5eb9d44cb15547dfdcfc01e46c9ca49b400b9.tar.gz |
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.
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 7 |
1 files changed, 3 insertions, 4 deletions
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 |