LaTeX reader: Basic \enquote support.

This commit is contained in:
John MacFarlane 2012-10-15 20:15:34 -07:00
parent ea34087cde
commit 6f9151c64e

View file

@ -426,6 +426,7 @@ inlineCommands = M.fromList $
pure (link url "" lab))
, ("includegraphics", skipopts *> (unescapeURL <$> braced) >>=
(\src -> pure (image src "" (str "image"))))
, ("enquote", enquote)
, ("cite", citation "cite" AuthorInText False False)
, ("citep", citation "citep" NormalCitation False False)
, ("citep*", citation "citep*" NormalCitation False False)
@ -489,6 +490,14 @@ unescapeURL ('\\':x:xs) | isEscapable x = x:unescapeURL xs
unescapeURL (x:xs) = x:unescapeURL xs
unescapeURL [] = ""
enquote :: LP Inlines
enquote = do
skipopts
context <- stateQuoteContext <$> getState
if context == InDoubleQuote
then singleQuoted <$> withQuoteContext InSingleQuote tok
else doubleQuoted <$> withQuoteContext InDoubleQuote tok
doverb :: LP Inlines
doverb = do
marker <- anyChar