diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Textile.hs | 13 | ||||
-rw-r--r-- | tests/textile-reader.native | 2 |
2 files changed, 14 insertions, 1 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 diff --git a/tests/textile-reader.native b/tests/textile-reader.native index 130866a37..d657521e6 100644 --- a/tests/textile-reader.native +++ b/tests/textile-reader.native @@ -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"]] |