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:
parent
df980b899d
commit
8b3ac98171
1 changed files with 8 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue