@@ -1644,7 +1644,9 @@ blockCommand = try $ do
16441644 let names = ordNub [name', name]
16451645 let rawDefiniteBlock = do
16461646 guard $ isBlockCommand name
1647− rawBlock "latex" <$> getRawCommand name (txt <> star)
1647+ rawcontents <- getRawCommand name (txt <> star)
1648+ (guardEnabled Ext_raw_tex >> return (rawBlock "latex" rawcontents))
1649+ <|> ignore rawcontents
16481650 -- heuristic: if it could be either block or inline, we
16491651 -- treat it if block if we have a sequence of block
16501652 -- commands followed by a newline. But we stop if we
@@ -1656,7 +1658,10 @@ blockCommand = try $ do
16561658 guard $ "start" `T.isPrefixOf` n
16571659 let rawMaybeBlock = try $ do
16581660 guard $ not $ isInlineCommand name
1659− curr <- rawBlock "latex" <$> getRawCommand name (txt <> star)
1661+ rawcontents <- getRawCommand name (txt <> star)
1662+ curr <- (guardEnabled Ext_raw_tex >>
1663+ return (rawBlock "latex" rawcontents))
1664+ <|> ignore rawcontents
16601665 rest <- many $ notFollowedBy startCommand *> blockCommand
16611666 lookAhead $ blankline <|> startCommand
16621667 return $ curr <> mconcat rest