Textile reader: Implemented comment blocks.

This commit is contained in:
John MacFarlane 2012-10-05 10:23:15 -07:00
parent b1dafe8750
commit f232034ab0
3 changed files with 18 additions and 1 deletions

View file

@ -125,6 +125,7 @@ blockParsers = [ codeBlock
, header
, blockQuote
, hrule
, commentBlock
, anyList
, rawHtmlBlock
, rawLaTeXBlock'
@ -136,6 +137,12 @@ blockParsers = [ codeBlock
block :: Parser [Char] ParserState Block
block = choice blockParsers <?> "block"
commentBlock :: Parser [Char] ParserState Block
commentBlock = try $ do
string "###."
manyTill anyLine blanklines
return Null
codeBlock :: Parser [Char] ParserState Block
codeBlock = codeBlockBc <|> codeBlockPre

View file

@ -155,4 +155,7 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
,Para [Str "\174",Space,Str "Hi",Str "\174"]
,Para [Str "Hi",Str "\169",Str "2008",Space,Str "\169",Space,Str "2008"]
,Header 1 [Str "Footnotes"]
,Para [Str "A",Space,Str "note",Str ".",Note [Para [Str "The",Space,Str "note",LineBreak,Str "is",Space,Str "here",Str "!"]],Space,Str "Another",Space,Str "note",Note [Para [Str "Other",Space,Str "note",Str "."]],Str "."]]
,Para [Str "A",Space,Str "note",Str ".",Note [Para [Str "The",Space,Str "note",LineBreak,Str "is",Space,Str "here",Str "!"]],Space,Str "Another",Space,Str "note",Note [Para [Str "Other",Space,Str "note",Str "."]],Str "."]
,Header 1 [Str "Comment",Space,Str "blocks"]
,Null
,Para [Str "not",Space,Str "a",Space,Str "comment",Str "."]]

View file

@ -243,3 +243,10 @@ fn1. The note
is here!
fn2. Other note.
h1. Comment blocks
###. my comment
is here.
not a comment.