Textile reader: Support <tt> for inline code.
This commit is contained in:
parent
50d08ec2c3
commit
1d683be414
3 changed files with 14 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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 ":"]
|
||||
|
|
|
@ -66,6 +66,8 @@ bc. Code block with .bc
|
|||
continued
|
||||
@</\
|
||||
|
||||
Inline code: @<tt>@, <tt>@</tt>.
|
||||
|
||||
h1. Lists
|
||||
|
||||
h2. Unordered
|
||||
|
|
Loading…
Add table
Reference in a new issue