git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: Fixed regression in list parsing

(introduced by recent changes to unknownCommand). git-svn-id: https://pandoc.googlecode.com/svn/trunk@1423 788f1e2b-df1e-0410-8736-df70ead52e1b

commitae30b5ae3758122641b3188098a014210e0b6714 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 6 Sep 2008, 20:45 (18 years ago) parent27b3146
1 file changed+3−3
Text/Pandoc/Readers/LaTeX.hs+3−3
Text/Pandoc/Readers/LaTeX.hs+3−3
@@ -400,13 +400,13 @@ unknownCommand = try $ do
400400 notFollowedBy' $ choice $ map end ["itemize", "enumerate", "description",
401401 "document"]
402402 state <- getState
403+ if stateParserContext state == ListItemState
404+ then notFollowedBy' $ string "\\item"
405+ else return ()
403406 if stateParseRaw state
404407 then do
405408 (name, star, args) <- command
406409 spaces
407− if name == "item" && stateParserContext state == ListItemState
408− then fail "should not be parsed as raw"
409− else return ""
410410 return $ Plain [TeX ("\\" ++ name ++ star ++ concat args)]
411411 else do -- skip unknown command, leaving arguments to be parsed
412412 char '\\'