LaTeX reader: Improved messages for skipped environments.
This commit is contained in:
parent
29b1ed0b84
commit
c76eec97d4
1 changed files with 13 additions and 5 deletions
|
@ -938,12 +938,20 @@ inlineEnvironment = try $ do
|
||||||
rawEnv :: PandocMonad m => String -> LP m Blocks
|
rawEnv :: PandocMonad m => String -> LP m Blocks
|
||||||
rawEnv name = do
|
rawEnv name = do
|
||||||
exts <- getOption readerExtensions
|
exts <- getOption readerExtensions
|
||||||
|
let parseRaw = extensionEnabled Ext_raw_tex exts
|
||||||
rawOptions <- mconcat <$> many rawopt
|
rawOptions <- mconcat <$> many rawopt
|
||||||
let addBegin x = "\\begin{" ++ name ++ "}" ++ rawOptions ++ x
|
let beginCommand = "\\begin{" ++ name ++ "}" ++ rawOptions
|
||||||
if extensionEnabled Ext_raw_tex exts
|
unless parseRaw $ do
|
||||||
then (rawBlock "latex" . addBegin) <$>
|
pos1 <- getPosition
|
||||||
(withRaw (env name blocks) >>= applyMacros' . snd)
|
warningWithPos pos1 $ "Skipped " ++ beginCommand
|
||||||
else env name blocks
|
(bs, raw) <- withRaw $ env name blocks
|
||||||
|
raw' <- applyMacros' raw
|
||||||
|
if parseRaw
|
||||||
|
then return $ rawBlock "latex" $ beginCommand ++ raw'
|
||||||
|
else do
|
||||||
|
pos2 <- getPosition
|
||||||
|
warningWithPos pos2 $ "Skipped \\end{" ++ name ++ "}"
|
||||||
|
return bs
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue