aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-19 15:17:51 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-19 15:17:51 -0800
commite647f761eddaabd2c8f956b83bfee13f566a3344 (patch)
treedb8595ac243afbb246af863011744abe68d159dd /src/Text/Pandoc
parent1b8a9711b8ca84d2e557f59c137c7cb025fbd2d0 (diff)
downloadpandoc-e647f761eddaabd2c8f956b83bfee13f566a3344.tar.gz
Use spaceChar instead of oneOf " \t" in rst reader.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/RST.hs10
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
---