git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: Guard against "begin", "end" in inlineCommand.

Removed these from list of inline commands.

commitccf314829b539762447dc67e506e77c03d3b6e05 authorJohn MacFarlane <fiddlosopher@gmail.com> dateSun 9 Sep 2012, 18:21 (14 years ago) parent579cdac
1 file changed+1−2
src/Text/Pandoc/Readers/LaTeX.hs+1−2
src/Text/Pandoc/Readers/LaTeX.hs+1−2
@@ -265,8 +265,6 @@ blockCommands = M.fromList $
265265 , ("closing", skipopts *> closing)
266266 --
267267 , ("rule", skipopts *> tok *> tok *> pure horizontalRule)
268− , ("begin", mzero) -- these are here so they won't be interpreted as inline
269− , ("end", mzero)
270268 , ("item", skipopts *> loose_item)
271269 , ("documentclass", skipopts *> braced *> preamble)
272270 , ("centerline", (para . trimInlines) <$> (skipopts *> tok))
@@ -321,6 +319,7 @@ section lvl = do
321319inlineCommand :: LP Inlines
322320inlineCommand = try $ do
323321 name <- anyControlSeq
322+ guard $ name /= "begin" && name /= "end"
324323 guard $ not $ isBlockCommand name
325324 parseRaw <- getOption readerParseRaw
326325 star <- option "" (string "*")