From 127851ea61ce3723caeed2bf0174e1977efc40cd Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 14 Jan 2013 16:06:45 -0800 Subject: Parsing: Simplified and improved singleQuoteStart. This makes 's', 'l', etc. parse properly. Formerly we had some English-centric heuristics, but they are no longer needed now that we keep track of the last 'Str' position in state. Closes #698. --- src/Text/Pandoc/Parsing.hs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs index e242aa6fb..8f085d579 100644 --- a/src/Text/Pandoc/Parsing.hs +++ b/src/Text/Pandoc/Parsing.hs @@ -161,7 +161,7 @@ import Text.HTML.TagSoup.Entity ( lookupEntity ) import Data.Default import qualified Data.Set as Set import Control.Monad.Reader -import Control.Applicative ((*>), (<*), liftA2) +import Control.Applicative ((*>), (<*), (<$), liftA2) import Data.Monoid type Parser t s = Parsec t s @@ -882,13 +882,7 @@ singleQuoteStart = do st <- getState -- single quote start can't be right after str guard $ stateLastStrPos st /= Just pos - try $ do charOrRef "'\8216\145" - notFollowedBy (oneOf ")!],;:-? \t\n") - notFollowedBy (char '.') <|> lookAhead (string "..." >> return ()) - notFollowedBy (try (oneOfStrings ["s","t","m","ve","ll","re"] >> - satisfy (not . isAlphaNum))) - -- possess/contraction - return () + () <$ charOrRef "'\8216\145" singleQuoteEnd :: Parser [Char] st () singleQuoteEnd = try $ do -- cgit v1.2.3