aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2011-12-27 15:45:34 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2011-12-27 15:45:34 -0800
commita579e2c89289b97fa4083c2c0e2299da9d44e9e0 (patch)
tree11976af7a06a442133f58baf70cff7c1445ec9f8 /src/Text/Pandoc/Readers
parent8838f473a825747fc00f61cbddfe3732fe3a9b6f (diff)
downloadpandoc-a579e2c89289b97fa4083c2c0e2299da9d44e9e0.tar.gz
Replaced Apostrophe, Ellipses, EmDash, EnDash w/ unicode strings.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs6
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs14
2 files changed, 9 insertions, 11 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index c418fef2a..708aa58c1 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -802,13 +802,13 @@ ellipses = try $ do
optional $ char 'l'
string "dots"
optional $ try $ string "{}"
- return Ellipses
+ return (Str "…")
enDash :: GenParser Char st Inline
-enDash = try (string "--") >> return EnDash
+enDash = try (string "--") >> return (Str "-")
emDash :: GenParser Char st Inline
-emDash = try (string "---") >> return EmDash
+emDash = try (string "---") >> return (Str "—")
hyphen :: GenParser Char st Inline
hyphen = char '-' >> return (Str "-")
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 ->