Simplified list parsing code in RST reader.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@356 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
fiddlosopher 2006-12-31 18:14:51 +00:00
parent df980b899d
commit 8b3ac98171

View file

@ -453,13 +453,14 @@ listItem start = try (do
-- count as list item markers, even if not separated by blank space.
-- see definition of "endline"
state <- getState
let parsed = case runParser parseBlocks
(state {stateParserContext = ListItemState}) "list item"
raw of
Left err -> error $ "Raw:\n" ++ raw ++
"\nError:\n" ++ show err
Right result -> result
where raw = concat (first:rest) ++ blanks
let oldContext = stateParserContext state
remaining <- getInput
setState $ state {stateParserContext = ListItemState}
-- parse the extracted block, which may itself contain block elements
setInput $ concat (first:rest) ++ blanks
parsed <- parseBlocks
setInput remaining
updateState (\st -> st {stateParserContext = oldContext})
return parsed)
orderedList = try (do