@@ -859,8 +859,14 @@ tok = try $ grouped inline <|> inlineCommand <|> str <$> count 1 inlineChar
859opt :: LP Inlines
859opt :: LP Inlines
860opt = bracketed inline
860opt = bracketed inline
864+ contents <- bracketed (many1 (noneOf "]") <|> try (string "\\]"))
866+ return $ "[" ++ contents ++ "]"
862skipopts :: LP ()
868skipopts :: LP ()
863−skipopts = skipMany (opt *> optional sp)
869+skipopts = skipMany rawopt
865inlineText :: LP Inlines
871inlineText :: LP Inlines
866inlineText = str <$> many1 inlineChar
872inlineText = str <$> many1 inlineChar
@@ -883,8 +889,9 @@ inlineEnvironment = try $ do
884rawEnv :: String -> LP Blocks
890rawEnv :: String -> LP Blocks
885rawEnv name = do
891rawEnv name = do
886− let addBegin x = "\\begin{" ++ name ++ "}" ++ x
887 parseRaw <- getOption readerParseRaw
892 parseRaw <- getOption readerParseRaw
893+ rawOptions <- mconcat <$> many rawopt
894+ let addBegin x = "\\begin{" ++ name ++ "}" ++ rawOptions ++ x
888 if parseRaw
895 if parseRaw
889 then (rawBlock "latex" . addBegin) <$>
896 then (rawBlock "latex" . addBegin) <$>
890 (withRaw (env name blocks) >>= applyMacros' . snd)
897 (withRaw (env name blocks) >>= applyMacros' . snd)