LaTeX reader: Use curly quotes for unmatched `.
Partially addresses #2555. Note that there's still a problem with the code sample given.
This commit is contained in:
parent
2633dc2f5e
commit
2eb5d2dc42
2 changed files with 9 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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 "{"]
|
||||
|
|
Loading…
Add table
Reference in a new issue