Textile reader: added hrule parser.
This commit is contained in:
parent
4bf9d362d2
commit
d4e512776d
2 changed files with 14 additions and 1 deletions
|
@ -106,6 +106,7 @@ blockParsers :: [GenParser Char ParserState Block]
|
|||
blockParsers = [ codeBlock
|
||||
, header
|
||||
, blockQuote
|
||||
, hrule
|
||||
, anyList
|
||||
, rawHtmlBlock'
|
||||
, maybeExplicitBlock "table" table
|
||||
|
@ -151,6 +152,18 @@ blockQuote = try $ do
|
|||
whitespace
|
||||
para >>= return . BlockQuote . (:[])
|
||||
|
||||
-- Horizontal rule
|
||||
|
||||
hrule :: GenParser Char st Block
|
||||
hrule = try $ do
|
||||
skipSpaces
|
||||
start <- oneOf "-*"
|
||||
count 2 (skipSpaces >> char start)
|
||||
skipMany (spaceChar <|> char start)
|
||||
newline
|
||||
optional blanklines
|
||||
return HorizontalRule
|
||||
|
||||
-- Lists handling
|
||||
|
||||
-- | Can be a bullet list or an ordered list. This implementation is
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Pandoc (Meta {docTitle = [Str ""], docAuthors = [[Str ""]], docDate = [Str ""]})
|
||||
[ Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc",Space,Str "Textile",Space,Str "Reader",Str ".",Space,Str "Part",Space,Str "of",Space,Str "it",Space,Str "comes",LineBreak,Str "from",Space,Str "John",Space,Str "Gruber",Str "'",Str "s",Space,Str "markdown",Space,Str "test",Space,Str "suite",Str "."]
|
||||
, Para [Strikeout [Str "-"],Str "-",Str "-"]
|
||||
, HorizontalRule
|
||||
, Header 1 [Str "Headers"]
|
||||
, Header 2 [Str "Level",Space,Str "2",Space,Str "with",Space,Str "an",Space,Link [Str "embeded",Space,Str "link"] ("http://www.example.com","")]
|
||||
, Header 3 [Str "Level",Space,Str "3",Space,Str "with",Space,Strong [Str "emphasis"]]
|
||||
|
|
Loading…
Add table
Reference in a new issue