aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-11-23 23:44:39 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-11-23 23:44:39 -0800
commit2eb5d2dc421245fa0a66ddb2f0599a076228413b (patch)
tree8032ca83147fa810c22ed2e1c8043d44e7fd2578 /src
parent2633dc2f5e6bb86e349fa2f2f7292d497f255a8d (diff)
downloadpandoc-2eb5d2dc421245fa0a66ddb2f0599a076228413b.tar.gz
LaTeX reader: Use curly quotes for unmatched `.
Partially addresses #2555. Note that there's still a problem with the code sample given.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 673deba14..241ac145a 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -166,8 +166,15 @@ mathChars = (concat <$>) $
quoted' :: (Inlines -> Inlines) -> LP String -> LP () -> LP Inlines
quoted' f starter ender = do
+ smart <- getOption readerSmart
startchs <- starter
- try ((f . mconcat) <$> manyTill inline ender) <|> lit startchs
+ ((f . mconcat) <$> manyTill inline ender) <|>
+ lit (if smart
+ then case startchs of
+ "``" -> "“"
+ "`" -> "‘"
+ _ -> startchs
+ else startchs)
doubleQuote :: LP Inlines
doubleQuote = do