From 1d683be4146678c5d674ecd9ea365943c385774c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 23 Jan 2011 00:25:05 -0800 Subject: Textile reader: Support for inline code. --- src/Text/Pandoc/Readers/Textile.hs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs index 05bcd6108..f9007d77c 100644 --- a/src/Text/Pandoc/Readers/Textile.hs +++ b/src/Text/Pandoc/Readers/Textile.hs @@ -368,9 +368,9 @@ inlineParsers = [ autoLink , str , whitespace , endline + , code , htmlSpan , rawHtmlInline - , code , note , simpleInline (string "??") (Cite []) , simpleInline (string "**") Strong @@ -490,8 +490,16 @@ symbol = do -- | Inline code code :: GenParser Char ParserState Inline -code = surrounded (char '@') anyChar >>= - return . Code +code = code1 <|> code2 + +code1 :: GenParser Char ParserState Inline +code1 = surrounded (char '@') anyChar >>= return . Code + +code2 :: GenParser Char ParserState Inline +code2 = do + htmlTag (tagOpen (=="tt") null) + result' <- manyTill anyChar (try $ htmlTag $ tagClose (=="tt")) + return $ Code result' -- | Html / CSS attributes attributes :: GenParser Char ParserState String -- cgit v1.2.3