From d4e512776d9e38ef613167dd48fda17104ff25d9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 3 Dec 2010 22:56:29 -0800 Subject: Textile reader: added hrule parser. --- src/Text/Pandoc/Readers/Textile.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/Text/Pandoc/Readers') diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs index f64c9e416..c2b92b75b 100644 --- a/src/Text/Pandoc/Readers/Textile.hs +++ b/src/Text/Pandoc/Readers/Textile.hs @@ -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 -- cgit v1.2.3