Bug 428947

Summary: Wrong LaTeX highlighting for bmatrix
Product: [Frameworks and Libraries] frameworks-syntax-highlighting Reporter: Vincent Tam <sere>
Component: syntaxAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: walter.von.entferndt
Priority: NOR    
Version First Reported In: 5.75.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: error result

Description Vincent Tam 2020-11-11 00:13:39 UTC
Created attachment 133213 [details]
error result

SUMMARY

The `bmatrix` environment is treated like an error in line 804 in `data/syntax/latex.xml` at commit 9ca2992a.

https://github.com/KDE/syntax-highlighting/blob/9ca2992afcaf9cafe57ef21459bdfaf78125fc22/data/syntax/latex.xml#L804


STEPS TO REPRODUCE
1. Save this file in `test.md`.

```tex
\begin{equation}
  \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix}
\end{equation}
```

2. Compile this with `pandoc test.md -o test.pdf`.  (I used pandoc 2.11.)
3. Open `test.pdf` and observe the color difference in `bmatrix`.

OBSERVED RESULT
They have different colors.

EXPECTED RESULT
They have the same color.

SOFTWARE/OS VERSIONS
Ubuntu 20.04, pandoc 2.11, TexLive 2020

ADDITIONAL INFORMATION
https://github.com/jgm/skylighting/issues/111
Comment 1 Bug Janitor Service 2020-11-23 01:25:35 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/109
Comment 2 Vincent Tam 2020-11-23 07:35:58 UTC
Thanks for info, but there's no mention about the "Error" attribute in the code change.  It seems that it's removing something underlined, but there's no underlined stuff in the screenshot.
Comment 3 Christoph Cullmann 2020-11-23 11:51:02 UTC
Git commit a29ad9cd1973f413852cb73df0ecb543f537ae09 by Christoph Cullmann, on behalf of Jonathan Poelen.
Committed on 23/11/2020 at 11:50.
Pushed by cullmann into branch 'master'.

Latex: some math environments can be nested

M  +1    -1    autotests/html/highlight.tex.dark.html
M  +1    -1    autotests/html/highlight.tex.html
M  +1    -1    autotests/reference/highlight.tex.ref
M  +0    -2    data/syntax/latex.xml

https://invent.kde.org/frameworks/syntax-highlighting/commit/a29ad9cd1973f413852cb73df0ecb543f537ae09