diff options
-rw-r--r-- | Text/Pandoc/Readers/LaTeX.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Text/Pandoc/Readers/LaTeX.hs b/Text/Pandoc/Readers/LaTeX.hs index 4cecebda1..7c52650e6 100644 --- a/Text/Pandoc/Readers/LaTeX.hs +++ b/Text/Pandoc/Readers/LaTeX.hs @@ -400,13 +400,13 @@ unknownCommand = try $ do notFollowedBy' $ choice $ map end ["itemize", "enumerate", "description", "document"] state <- getState + if stateParserContext state == ListItemState + then notFollowedBy' $ string "\\item" + else return () if stateParseRaw state then do (name, star, args) <- command spaces - if name == "item" && stateParserContext state == ListItemState - then fail "should not be parsed as raw" - else return "" return $ Plain [TeX ("\\" ++ name ++ star ++ concat args)] else do -- skip unknown command, leaving arguments to be parsed char '\\' |