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 diff --git a/tests/textile-reader.native b/tests/textile-reader.native index a00507282..9c971c105 100644 --- a/tests/textile-reader.native +++ b/tests/textile-reader.native @@ -25,6 +25,7 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []}) ,Para [Str "And",Str ":"] ,CodeBlock ("",[],[]) " this code block is indented by two tabs\n\n These should not be escaped: \\$ \\\\ \\> \\[ \\{" ,CodeBlock ("",[],[]) "Code block with .bc\n continued\n @</\\\n" +,Para [Str "Inline",Space,Str "code",Str ":",Space,Code "<tt>",Str ",",Space,Code "@",Str "."] ,Header 1 [Str "Lists"] ,Header 2 [Str "Unordered"] ,Para [Str "Asterisks",Space,Str "tight",Str ":"] diff --git a/tests/textile-reader.textile b/tests/textile-reader.textile index 9fa90bb32..4ae47ea20 100644 --- a/tests/textile-reader.textile +++ b/tests/textile-reader.textile @@ -66,6 +66,8 @@ bc. Code block with .bc continued @</\ +Inline code: @<tt>@, <tt>@</tt>. + h1. Lists h2. Unordered