diff options
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 9 | ||||
-rw-r--r-- | tests/latex-reader.native | 2 |
2 files changed, 9 insertions, 2 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 diff --git a/tests/latex-reader.native b/tests/latex-reader.native index 0bb24714e..9618d02cd 100644 --- a/tests/latex-reader.native +++ b/tests/latex-reader.native @@ -302,7 +302,7 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa ,Para [Str "4",Space,Str "<",Space,Str "5."] ,Para [Str "6",Space,Str ">",Space,Str "5."] ,Para [Str "Backslash:",Space,Str "\\"] -,Para [Str "Backtick:",Space,Str "`"] +,Para [Str "Backtick:",Space,Str "\8216"] ,Para [Str "Asterisk:",Space,Str "*"] ,Para [Str "Underscore:",Space,Str "_"] ,Para [Str "Left",Space,Str "brace:",Space,Str "{"] |