From 6f9151c64ee16819d99ae4c9d0bef8fb9083d936 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 15 Oct 2012 20:15:34 -0700 Subject: LaTeX reader: Basic \enquote support. --- src/Text/Pandoc/Readers/LaTeX.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Text/Pandoc/Readers/LaTeX.hs') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 54a39f24f..2eecf9633 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -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 -- cgit v1.2.3