New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weird highlighting of Matlab lexer #1490
Comments
If you post the code as text, together with a minimal LaTeX snippet using minted, I can try to reproduce here. But I suspect it's not a Pygments problem, since the demo output looks ok. |
@birkenfeld Thanks for your response. I use pygment in terminal and get that html file which performs just like in my LaTeX file. I suspect my local version is wrong, but it is 2.6.1. > pygmentize -V
Pygments version 2.6.1, (c) 2006-2019 by Georg Brandl. Here is how I use minted in LaTeX: \documentclass[10pt, a4paper]{article}
\usepackage[left=3.17cm, right=3.17cm, top=2.54cm, bottom=2.54cm]{geometry}
\usepackage[UTF8]{ctex}
\setmonofont[]{Fira Code}
\usepackage{minted}
\usemintedstyle{rainbow_dash}
\begin{document}
\definecolor{bg}{rgb}{0.95,0.95,0.95}
\begin{minted}[bgcolor=bg]{Matlab}
function output = zigzag(input)
[r, c] = size(input);
output = zeros(1, r * c);
i = 1;
j = 1;
cnt = 1;
while ((i <= r) && (j <= c))
output(cnt) = input(i, j);
cnt = cnt + 1;
if (mod(i + j, 2)) % odd => down
if (i == r)
j = j + 1;
elseif (j == 1)
i = i + 1;
else
i = i + 1;
j = j - 1;
end
else % even => up
if (j == c)
i = i + 1;
elseif (i == 1)
j = j + 1;
else
i = i - 1;
j = j + 1;
end
end
end
end
\end{minted}
\end{document} |
OK, I can reproduce with 2.6.1. This seems to have been introduced recently. |
There were quite a few changes recently to Matlab around property handling, I suspect one of them might have been the cause :( The MRs should be all in the changelog already. |
I think this is the same as #1706. |
This one seems to already have been fixed in master. |
Thanks for checking! |
I'm using minted to highlight my code. I got a very weird highlighting, and it is different from the demo page. Please forgive me if I ignore any issue related to this problem.
I use
pygmentize -f html -O full -O style=rainbow_dash -l Matlab -o test.html exp2_7.m
and get the following html file:I think some lines are mistakenly recognized as Literal.String. And the demo page give this
The text was updated successfully, but these errors were encountered: