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

commit127851ea61ce3723caeed2bf0174e1977efc40cd authorJohn MacFarlane <jgm@berkeley.edu> dateMon 14 Jan 2013, 16:06 (14 years ago) parent360f8a3
1 file changed+2−8
src/Text/Pandoc/Parsing.hs+2−8
src/Text/Pandoc/Parsing.hs+2−8
@@ -161,7 +161,7 @@ import Text.HTML.TagSoup.Entity ( lookupEntity )
161161import Data.Default
162162import qualified Data.Set as Set
163163import Control.Monad.Reader
164−import Control.Applicative ((*>), (<*), liftA2)
164+import Control.Applicative ((*>), (<*), (<$), liftA2)
165165import Data.Monoid
166166
167167type Parser t s = Parsec t s
@@ -882,13 +882,7 @@ singleQuoteStart = do
882882 st <- getState
883883 -- single quote start can't be right after str
884884 guard $ stateLastStrPos st /= Just pos
885− try $ do charOrRef "'\8216\145"
886− notFollowedBy (oneOf ")!],;:-? \t\n")
887− notFollowedBy (char '.') <|> lookAhead (string "..." >> return ())
888− notFollowedBy (try (oneOfStrings ["s","t","m","ve","ll","re"] >>
889− satisfy (not . isAlphaNum)))
890− -- possess/contraction
891− return ()
885+ () <$ charOrRef "'\8216\145"
892886
893887singleQuoteEnd :: Parser [Char] st ()
894888singleQuoteEnd = try $ do