aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2013-01-14 16:06:45 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2013-01-14 16:06:45 -0800
commit127851ea61ce3723caeed2bf0174e1977efc40cd (patch)
treecc2003fceac62e6653c0c0930a188810395088a6 /src/Text/Pandoc
parent360f8a3d011169679be558d5e61c1a53d421f19c (diff)
downloadpandoc-127851ea61ce3723caeed2bf0174e1977efc40cd.tar.gz
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.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Parsing.hs10
1 files changed, 2 insertions, 8 deletions
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