minted icon indicating copy to clipboard operation
minted copied to clipboard

[bug] `gobble` results in malformed formatting, `autogobble` works

Open goyalyashpal opened this issue 7 months ago • 5 comments

image

MWE:

Note: here

  • the 4 spaces are caused due to indentation inside the filecontents block,
  • so, autogobble and gobble=4 shall be equivalent,
  • as can be seen from eyeballing too, that both the outputs align
  • but something else too is happening in gobble (like say maybe insertion of some ghost character or change of encoding etc) which causes the pygments to fail to recognize it as proper file & hence results in malformed formatting
  • compiled with xelatex --shell-escape document.tex
\begin{filecontents}[noheader, overwrite]{./test.mysql}
    mysql-> select * from firstLine;
    mysql-> select * from secondLine;
    mysql-> \help contents
    mysql-> \h contents
\end{filecontents}

\documentclass{article}
\usepackage{minted}


\begin{document}

\inputminted[autogobble]{psql}{test.mysql}    % Works
\inputminted[gobble=4]{psql}{test.mysql}    % Buggy

\end{document}


just for my reference, first noticed filecontents at https://github.com/gpoore/minted/issues/378#issuecomment-1794025908

goyalyashpal avatar Nov 12 '23 07:11 goyalyashpal