summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Textile.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-12-03 22:56:29 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2010-12-03 23:10:52 -0800
commitd4e512776d9e38ef613167dd48fda17104ff25d9 (patch)
treeff9593db4e9140299e11aa84494eb350cea27b03 /src/Text/Pandoc/Readers/Textile.hs
parent4bf9d362d22fcd7b51da7bd14a6a5b63533706c6 (diff)
Textile reader: added hrule parser.
Diffstat (limited to 'src/Text/Pandoc/Readers/Textile.hs')
-rw-r--r--src/Text/Pandoc/Readers/Textile.hs13
1 files changed, 13 insertions, 0 deletions
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