Skip to content

The escapeinside argument to the latex formatter breaks pycon input #1516

@eric-wieser

Description

@eric-wieser

With .\tmp.txt containing

>>> where_did_this_go = str('e_x e_y e_z')

the command

pygments -l pycon -f latex -O escapeinside=QQ .\tmp.txt

gives

\begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8}]
\PY{l+s+s1}{\PYZsq{}}\PY{l+s+s1}{e\PYZus{}x e\PYZus{}y e\PYZus{}z}\PY{l+s+s1}{\PYZsq{}}\PY{g+go}{)}
\end{Verbatim}

Q doesn't even appear anywhere in my input - so why is the output getting mangled?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions