From 925a4c5164026bfda25bf50b552bacec074fdf3f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 29 Dec 2011 23:44:12 -0800 Subject: Better smart quote parsing. * Added stateLastStrPos to ParserState. This lets us keep track of whether we're parsing the position immediately after a 'str'. If we encounter a ' in such a location, it must be an apostrophe, and can't be a single quote start. * Set this in the markdown, textile, html, and rst str parsers. * Closes #360. --- src/Text/Pandoc/Readers/Textile.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Text/Pandoc/Readers/Textile.hs') diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs index 12d299aa4..4693bd06d 100644 --- a/src/Text/Pandoc/Readers/Textile.hs +++ b/src/Text/Pandoc/Readers/Textile.hs @@ -436,6 +436,8 @@ str = do next <- lookAhead letter guard $ isLetter (last xs) || isLetter next return $ xs ++ "-" + pos <- getPosition + updateState $ \s -> s{ stateLastStrPos = Just pos } return $ Str result -- | Textile allows HTML span infos, we discard them -- cgit v1.2.3