diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2006-12-31 18:14:51 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2006-12-31 18:14:51 +0000 |
commit | 8b3ac981713b109ce01b0c369117ae9a09bb22c4 (patch) | |
tree | 4c6db437acee9ad6471c9eaaf4db5a83e6f2a6c5 /src/Text/Pandoc/Readers/RST.hs | |
parent | df980b899d7ad5107f3f9492e5ac983e98e09ade (diff) | |
download | pandoc-8b3ac981713b109ce01b0c369117ae9a09bb22c4.tar.gz |
Simplified list parsing code in RST reader.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@356 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Readers/RST.hs')
-rw-r--r-- | src/Text/Pandoc/Readers/RST.hs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index 419876ed1..a3b9bfca7 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -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 |