git.iko.soy/typeable/pandoc
on master help sign in
Textile reader: Implemented comment blocks.
f232034John MacFarlane
src/Text/Pandoc/Readers/Textile.hs+7
@@ -125,6 +125,7 @@ blockParsers = [ codeBlock
125 , header
125 , header
126 , blockQuote
126 , blockQuote
127 , hrule
127 , hrule
128+ , commentBlock
128 , anyList
129 , anyList
129 , rawHtmlBlock
130 , rawHtmlBlock
130 , rawLaTeXBlock'
131 , rawLaTeXBlock'
@@ -136,6 +137,12 @@ blockParsers = [ codeBlock
136block :: Parser [Char] ParserState Block
137block :: Parser [Char] ParserState Block
137block = choice blockParsers <?> "block"
138block = choice blockParsers <?> "block"
138
139
140+commentBlock :: Parser [Char] ParserState Block
141+commentBlock = try $ do
142+ string "###."
143+ manyTill anyLine blanklines
144+ return Null
145+
139codeBlock :: Parser [Char] ParserState Block
146codeBlock :: Parser [Char] ParserState Block
140codeBlock = codeBlockBc <|> codeBlockPre
147codeBlock = codeBlockBc <|> codeBlockPre
141
148
tests/textile-reader.native+4−1
@@ -155,4 +155,7 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
155,Para [Str "\174",Space,Str "Hi",Str "\174"]
155,Para [Str "\174",Space,Str "Hi",Str "\174"]
156,Para [Str "Hi",Str "\169",Str "2008",Space,Str "\169",Space,Str "2008"]
156,Para [Str "Hi",Str "\169",Str "2008",Space,Str "\169",Space,Str "2008"]
157,Header 1 [Str "Footnotes"]
157,Header 1 [Str "Footnotes"]
158−,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 "."]]
158+,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 "."]
159+,Header 1 [Str "Comment",Space,Str "blocks"]
160+,Null
161+,Para [Str "not",Space,Str "a",Space,Str "comment",Str "."]]
tests/textile-reader.textile+7
@@ -243,3 +243,10 @@ fn1. The note
243is here!
243is here!
244
244
245fn2. Other note.
245fn2. Other note.
246+
247+h1. Comment blocks
248+
249+###. my comment
250+is here.
251+
252+not a comment.