From e647f761eddaabd2c8f956b83bfee13f566a3344 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 19 Jan 2011 15:17:51 -0800 Subject: Use spaceChar instead of oneOf " \t" in rst reader. --- src/Text/Pandoc/Readers/RST.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index 0a157d1cf..f0fa0e877 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -150,13 +150,13 @@ fieldListItem indent = try $ do string ": " skipSpaces first <- manyTill anyChar newline - rest <- option "" $ try $ lookAhead (string indent >> oneOf " \t") >> + rest <- option "" $ try $ lookAhead (string indent >> spaceChar) >> indentedBlock return (name, intercalate " " (first:(lines rest))) fieldList :: GenParser Char ParserState Block fieldList = try $ do - indent <- lookAhead $ many (oneOf " \t") + indent <- lookAhead $ many spaceChar items <- many1 $ fieldListItem indent blanklines let authors = case lookup "Authors" items of @@ -190,7 +190,7 @@ fieldList = try $ do lineBlockLine :: GenParser Char ParserState [Inline] lineBlockLine = try $ do string "| " - white <- many (oneOf " \t") + white <- many spaceChar line <- many $ (notFollowedBy newline >> inline) <|> (try $ endline >>~ char ' ') optional endline return $ normalizeSpaces $ (if null white then [] else [Str white]) ++ line @@ -325,7 +325,7 @@ indentedLine indents = try $ do -- any amount of indentation will work. indentedBlock :: GenParser Char st [Char] indentedBlock = do - indents <- lookAhead $ many1 (oneOf " \t") + indents <- lookAhead $ many1 spaceChar lns <- many $ choice $ [ indentedLine indents, try $ do b <- blanklines l <- indentedLine indents @@ -509,7 +509,7 @@ unknownDirective = try $ do string ".." notFollowedBy (noneOf " \t\n") manyTill anyChar newline - many $ blanklines <|> (oneOf " \t" >> manyTill anyChar newline) + many $ blanklines <|> (spaceChar >> manyTill anyChar newline) return Null --- -- cgit v1.2.3