diff options
author | John MacFarlane <jgm@berkeley.edu> | 2011-01-19 15:17:51 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2011-01-19 15:17:51 -0800 |
commit | e647f761eddaabd2c8f956b83bfee13f566a3344 (patch) | |
tree | db8595ac243afbb246af863011744abe68d159dd /src | |
parent | 1b8a9711b8ca84d2e557f59c137c7cb025fbd2d0 (diff) | |
download | pandoc-e647f761eddaabd2c8f956b83bfee13f566a3344.tar.gz |
Use spaceChar instead of oneOf " \t" in rst reader.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/RST.hs | 10 |
1 files changed, 5 insertions, 5 deletions
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 --- |