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.
This commit is contained in:
John MacFarlane
2018-04-16 23:15:09 -07:00
parent 57256d6d91
commit 8ac5eb9d44
+3 -4
View File
@@ -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