pandoc/test/command/7497.md
John MacFarlane 418155aa95 Fix raw LaTeX injection issue (LaTeX writer).
Using a code block containing `\end{verbatim}`, one could
inject raw TeX into a LaTeX document even when `raw_tex`
is disabled.  Thanks to Augustin Laville for noticing the
bug.

Closes #7497.
2021-08-13 11:27:04 -07:00

633 B

% pandoc -f markdown-raw_tex -t latex
```
\end{verbatim}
\LaTeX
\begin{verbatim}
```
^D
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{\textbackslash{}end\{verbatim\}}
\NormalTok{\textbackslash{}LaTeX}
\NormalTok{\textbackslash{}begin\{verbatim\}}
\end{Highlighting}
\end{Shaded}
% pandoc -f markdown-raw_tex -t latex
hi[^1]

[^1]:
    ```
    \end{Verbatim}
    \LaTeX
    \begin{Verbatim}
    ```
^D
hi\footnote{\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{\textbackslash{}end\{Verbatim\}}
\NormalTok{\textbackslash{}LaTeX}
\NormalTok{\textbackslash{}begin\{Verbatim\}}
\end{Highlighting}
\end{Shaded}
}