diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2008-12-02 22:43:49 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2008-12-02 22:43:49 +0000 |
commit | f8ab1c78906fdbe1513c9df0345eca592fa0fc0a (patch) | |
tree | 797270638696dbc1dde14ccdbb8f67b2ac297e22 /Text | |
parent | d4b9307ce4a5fdc112b5bbb689cb98dcdd72e8e3 (diff) | |
download | pandoc-f8ab1c78906fdbe1513c9df0345eca592fa0fc0a.tar.gz |
LaTeX reader: parse |inline lhs| if source is lhs.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1511 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Text')
-rw-r--r-- | Text/Pandoc/Readers/LaTeX.hs | 11 |
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 |