aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Text/Pandoc/Readers/LaTeX.hs11
1 files changed, 9 insertions, 2 deletions
diff --git a/Text/Pandoc/Readers/LaTeX.hs b/Text/Pandoc/Readers/LaTeX.hs
index 537fdf377..f35ab4f29 100644
--- a/Text/Pandoc/Readers/LaTeX.hs
+++ b/Text/Pandoc/Readers/LaTeX.hs
@@ -570,8 +570,8 @@ gt = try (string "\\textgreater") >> optional (try $ string "{}") >> return (Str
doubleQuote :: GenParser Char st Inline
doubleQuote = char '"' >> return (Str "\"")
-code :: GenParser Char st Inline
-code = code1 <|> code2
+code :: GenParser Char ParserState Inline
+code = code1 <|> code2 <|> lhsInlineCode
code1 :: GenParser Char st Inline
code1 = try $ do
@@ -586,6 +586,13 @@ code2 = try $ do
result <- manyTill (noneOf "\\\n~$%^&{}") (char '}')
return $ Code result
+lhsInlineCode :: GenParser Char ParserState Inline
+lhsInlineCode = try $ do
+ failUnlessLHS
+ char '|'
+ result <- manyTill (noneOf "|\n") (char '|')
+ return $ Code result
+
emph :: GenParser Char ParserState Inline
emph = try $ oneOfStrings [ "\\emph{", "\\textit{" ] >>
manyTill inline (char '}') >>= return . Emph