git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: Use curly quotes for unmatched `.
2eb5d2dJohn MacFarlane
src/Text/Pandoc/Readers/LaTeX.hs+8−1
@@ -166,8 +166,15 @@ mathChars = (concat <$>) $
166
166
167quoted' :: (Inlines -> Inlines) -> LP String -> LP () -> LP Inlines
167quoted' :: (Inlines -> Inlines) -> LP String -> LP () -> LP Inlines
168quoted' f starter ender = do
168quoted' f starter ender = do
169+ smart <- getOption readerSmart
169 startchs <- starter
170 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)
171
178
172doubleQuote :: LP Inlines
179doubleQuote :: LP Inlines
173doubleQuote = do
180doubleQuote = do
tests/latex-reader.native+1−1
@@ -302,7 +302,7 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
302,Para [Str "4",Space,Str "<",Space,Str "5."]
302,Para [Str "4",Space,Str "<",Space,Str "5."]
303,Para [Str "6",Space,Str ">",Space,Str "5."]
303,Para [Str "6",Space,Str ">",Space,Str "5."]
304,Para [Str "Backslash:",Space,Str "\\"]
304,Para [Str "Backslash:",Space,Str "\\"]
305−,Para [Str "Backtick:",Space,Str "`"]
305+,Para [Str "Backtick:",Space,Str "\8216"]
306,Para [Str "Asterisk:",Space,Str "*"]
306,Para [Str "Asterisk:",Space,Str "*"]
307,Para [Str "Underscore:",Space,Str "_"]
307,Para [Str "Underscore:",Space,Str "_"]
308,Para [Str "Left",Space,Str "brace:",Space,Str "{"]
308,Para [Str "Left",Space,Str "brace:",Space,Str "{"]