LaTeX reader: Basic \enquote support.
This commit is contained in:
parent
ea34087cde
commit
6f9151c64e
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue