aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-10-15 20:15:34 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-10-15 20:15:34 -0700
commit6f9151c64ee16819d99ae4c9d0bef8fb9083d936 (patch)
tree0ab1e01160d32dcdd59f75b7058490ffd0cf00ae /src/Text
parentea34087cde44bc941ef0280d10de775a8c7e5426 (diff)
downloadpandoc-6f9151c64ee16819d99ae4c9d0bef8fb9083d936.tar.gz
LaTeX reader: Basic \enquote support.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs9
1 files changed, 9 insertions, 0 deletions
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