git.iko.soy/typeable/pandoc
on master help sign in
Markdown reader: Handle unmatched double quotes in dialogues.

They do not generate a Quoted element; instead, the double quote is just turned into a Str with a curly left quote. This should satisfy the fiction writers. Closes #99 (again).

commitd820eb2c47bccfd81a51503e997596addb584198 authorJohn MacFarlane <fiddlosopher@gmail.com> dateTue 12 Mar 2013, 19:18 (14 years ago) parent54782c2
1 file changed+8−3
src/Text/Pandoc/Readers/Markdown.hs+8−3
src/Text/Pandoc/Readers/Markdown.hs+8−3
@@ -1748,9 +1748,14 @@ singleQuoted = try $ do
17481748 fmap B.singleQuoted . trimInlinesF . mconcat <$>
17491749 many1Till inline singleQuoteEnd
17501750
1751+-- doubleQuoted will handle regular double-quoted sections, as well
1752+-- as dialogues with an open double-quote without a close double-quote
1753+-- in the same paragraph.
17511754doubleQuoted :: MarkdownParser (F Inlines)
17521755doubleQuoted = try $ do
17531756 doubleQuoteStart
1754− withQuoteContext InDoubleQuote $
1755− fmap B.doubleQuoted . trimInlinesF . mconcat <$>
1756− many1Till inline doubleQuoteEnd
1757+ contents <- mconcat <$> many (try $ notFollowedBy doubleQuoteEnd >> inline)
1758+ (withQuoteContext InDoubleQuote $ doubleQuoteEnd >> return
1759+ (fmap B.doubleQuoted . trimInlinesF $ contents))
1760+ <|> (return $ return (B.str "\8220") <> contents)
1761+