git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: Use curly quotes for unmatched `.

Partially addresses #2555. Note that there's still a problem with the code sample given.

commit2eb5d2dc421245fa0a66ddb2f0599a076228413b authorJohn MacFarlane <jgm@berkeley.edu> dateMon 23 Nov 2015, 23:44 (11 years ago) parent2633dc2
2 files changed+9−2
src/Text/Pandoc/Readers/LaTeX.hs+8−1 tests/latex-reader.native+1−1
src/Text/Pandoc/Readers/LaTeX.hs+8−1
@@ -166,8 +166,15 @@ mathChars = (concat <$>) $
166166
167167quoted' :: (Inlines -> Inlines) -> LP String -> LP () -> LP Inlines
168168quoted' f starter ender = do
169+ smart <- getOption readerSmart
169170 startchs <- starter
170− try ((f . mconcat) <$> manyTill inline ender) <|> lit startchs
171+ ((f . mconcat) <$> manyTill inline ender) <|>
172+ lit (if smart
173+ then case startchs of
174+ "``" -> "“"
175+ "`" -> "‘"
176+ _ -> startchs
177+ else startchs)
171178
172179doubleQuote :: LP Inlines
173180doubleQuote = do
tests/latex-reader.native+1−1
@@ -302,7 +302,7 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
302302,Para [Str "4",Space,Str "<",Space,Str "5."]
303303,Para [Str "6",Space,Str ">",Space,Str "5."]
304304,Para [Str "Backslash:",Space,Str "\\"]
305−,Para [Str "Backtick:",Space,Str "`"]
305+,Para [Str "Backtick:",Space,Str "\8216"]
306306,Para [Str "Asterisk:",Space,Str "*"]
307307,Para [Str "Underscore:",Space,Str "_"]
308308,Para [Str "Left",Space,Str "brace:",Space,Str "{"]