aboutsummaryrefslogtreecommitdiff
path: root/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-11-06 16:49:45 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-11-06 16:49:45 +0000
commit22549e19c6017f6b34692c3cc0eb994e4790709b (patch)
tree73d6fd44882ab6474eb79ed2dcc45872c073c176 /Text/Pandoc/Readers
parentf0e7d255928533b24a29d8df24bc00ef25bbd18e (diff)
downloadpandoc-22549e19c6017f6b34692c3cc0eb994e4790709b.tar.gz
Fixed parsing of RST comment blocks.
Modified 'unknown directive' in RST reader. Added RST reader tests for comment blocks. Resolves Issue #86 and Debian Bug#500662. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1484 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Text/Pandoc/Readers')
-rw-r--r--Text/Pandoc/Readers/RST.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Text/Pandoc/Readers/RST.hs b/Text/Pandoc/Readers/RST.hs
index 5533d309f..50075ae65 100644
--- a/Text/Pandoc/Readers/RST.hs
+++ b/Text/Pandoc/Readers/RST.hs
@@ -367,6 +367,8 @@ list = choice [ bulletList, orderedList, definitionList ] <?> "list"
definitionListItem :: GenParser Char ParserState ([Inline], [Block])
definitionListItem = try $ do
+ -- avoid capturing a directive or comment
+ notFollowedBy (try $ char '.' >> char '.')
term <- many1Till inline endline
raw <- indentedBlock
-- parse the extracted block, which may contain various block elements:
@@ -464,11 +466,10 @@ bulletList = many1 (listItem bulletListStart) >>=
unknownDirective :: GenParser Char st Block
unknownDirective = try $ do
- string ".. "
+ string ".."
+ notFollowedBy (noneOf " \t\n")
manyTill anyChar newline
- many (string " :" >> many1 (noneOf "\n:") >> char ':' >>
- many1 (noneOf "\n") >> newline)
- optional blanklines
+ many $ blanklines <|> (oneOf " \t" >> manyTill anyChar newline)
return Null
--