git.iko.soy/typeable/pandoc
on master help sign in
Textile reader: Implemented comment blocks.
commitf232034ab0a97c71643901a116ed1c55c5fb7f29 authorJohn MacFarlane <fiddlosopher@gmail.com> dateFri 5 Oct 2012, 10:23 (14 years ago) parentb1dafe8
3 files changed+18−1
src/Text/Pandoc/Readers/Textile.hs+7 tests/textile-reader.native+4−1 tests/textile-reader.textile+7
src/Text/Pandoc/Readers/Textile.hs+7
@@ -125,6 +125,7 @@ blockParsers = [ codeBlock
125125 , header
126126 , blockQuote
127127 , hrule
128+ , commentBlock
128129 , anyList
129130 , rawHtmlBlock
130131 , rawLaTeXBlock'
@@ -136,6 +137,12 @@ blockParsers = [ codeBlock
136137block :: Parser [Char] ParserState Block
137138block = choice blockParsers <?> "block"
138139
140+commentBlock :: Parser [Char] ParserState Block
141+commentBlock = try $ do
142+ string "###."
143+ manyTill anyLine blanklines
144+ return Null
145+
139146codeBlock :: Parser [Char] ParserState Block
140147codeBlock = codeBlockBc <|> codeBlockPre
141148
tests/textile-reader.native+4−1
@@ -155,4 +155,7 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
155155,Para [Str "\174",Space,Str "Hi",Str "\174"]
156156,Para [Str "Hi",Str "\169",Str "2008",Space,Str "\169",Space,Str "2008"]
157157,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
243243is here!
244244
245245fn2. Other note.
246+
247+h1. Comment blocks
248+
249+###. my comment
250+is here.
251+
252+not a comment.