diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2011-12-27 15:45:34 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2011-12-27 15:45:34 -0800 |
commit | a579e2c89289b97fa4083c2c0e2299da9d44e9e0 (patch) | |
tree | 11976af7a06a442133f58baf70cff7c1445ec9f8 /src/Text/Pandoc/Readers/Markdown.hs | |
parent | 8838f473a825747fc00f61cbddfe3732fe3a9b6f (diff) | |
download | pandoc-a579e2c89289b97fa4083c2c0e2299da9d44e9e0.tar.gz |
Replaced Apostrophe, Ellipses, EmDash, EnDash w/ unicode strings.
Diffstat (limited to 'src/Text/Pandoc/Readers/Markdown.hs')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 96b2d4315..db68df629 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1087,20 +1087,18 @@ nonEndline = satisfy (/='\n') str :: GenParser Char ParserState Inline str = do - st <- getState + smart <- stateSmart `fmap` getState a <- alphaNum as <- many $ alphaNum <|> (try $ char '_' >>~ lookAhead alphaNum) - <|> if stateStrict st - then mzero - else (try $ satisfy (\c -> c == '\'' || c == '\x2019') >> + <|> if smart + then (try $ satisfy (\c -> c == '\'' || c == '\x2019') >> lookAhead alphaNum >> return '\x2019') - -- for things like l'aide - would be better to return - -- an Apostrophe, but we can't in this context + -- for things like l'aide + else mzero let result = a:as - state <- getState let spacesToNbr = map (\c -> if c == ' ' then '\160' else c) - if stateSmart state + if smart then case likelyAbbrev result of [] -> return $ Str result xs -> choice (map (\x -> |