git.iko.soy/typeable/pandoc
on master help sign in
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.

commit8ac5eb9d44cb15547dfdcfc01e46c9ca49b400b9 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 16 Apr 2018, 23:15 (9 years ago) parent57256d6
1 file changed+3−4
src/Text/Pandoc/Readers/Markdown.hs+3−4
src/Text/Pandoc/Readers/Markdown.hs+3−4
@@ -2146,7 +2146,6 @@ singleQuoted = try $ do
21462146doubleQuoted :: PandocMonad m => MarkdownParser m (F Inlines)
21472147doubleQuoted = try $ do
21482148 doubleQuoteStart
2149− contents <- mconcat <$> many (try $ notFollowedBy doubleQuoteEnd >> inline)
2150− withQuoteContext InDoubleQuote (doubleQuoteEnd >> return
2151− (fmap B.doubleQuoted . trimInlinesF $ contents))
2152− <|> return (return (B.str "\8220") <> contents)
2149+ withQuoteContext InDoubleQuote $
2150+ fmap B.doubleQuoted . trimInlinesF . mconcat <$>
2151+ many1Till inline doubleQuoteEnd