Bug 410477 - Syntax Highlighting LaTeX: wrong color for \end{split} in environment equation
Summary: Syntax Highlighting LaTeX: wrong color for \end{split} in environment equation
Status: RESOLVED FIXED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (other bugs)
Version First Reported In: 5.60.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Nibaldo G.
URL:
Keywords:
: 274440 322081 322144 408297 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-08-01 10:28 UTC by Raphaël Jakse
Modified: 2019-08-09 03:37 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 5.62.0
Sentry Crash Report:


Attachments
Screenshot of the issue (wrong color for \end{split} is an equation environment) (26.95 KB, image/png)
2019-08-01 10:28 UTC, Raphaël Jakse
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raphaël Jakse 2019-08-01 10:28:30 UTC
Created attachment 121880 [details]
Screenshot of the issue (wrong color for \end{split} is an equation environment)

With the following text using LaTeX syntax highlighting:

\begin{equation}
\begin{split}
1+1
\end{split}
\end{equation}

OBSERVED

Both "equation" words and the first "split" word are in bold blue.
1+1 is in orange (as probably expected)
"split}" is in orange.

EXPECTED

The second "split" should be in bold blue, the closing brace right after should be in black.

VERSION:

Updated openSUSE Tumbleweed and Neon docker image.

SEE ALSO

Related: https://bugs.kde.org/show_bug.cgi?id=274440
Comment 1 Nibaldo G. 2019-08-07 07:04:49 UTC
When writing "\end{something}" within a Math environment, the highlighter considers it as the end of the same Math environment. For example, in this case, the highlighter believes that "\end{split}" is the end of "equation", but shows incorrect highlighting, since "split" doesn't correspond to a valid keyword of a Math environment.

I will upload a patch to fix it.
Comment 2 Nibaldo G. 2019-08-07 07:33:04 UTC
*** Bug 274440 has been marked as a duplicate of this bug. ***
Comment 3 Nibaldo G. 2019-08-07 07:50:00 UTC
*** Bug 408297 has been marked as a duplicate of this bug. ***
Comment 4 Nibaldo G. 2019-08-07 07:52:17 UTC
*** Bug 322081 has been marked as a duplicate of this bug. ***
Comment 5 Nibaldo G. 2019-08-07 07:55:03 UTC
*** Bug 322144 has been marked as a duplicate of this bug. ***
Comment 6 Jonathan Poelen 2019-08-09 00:07:05 UTC
Git commit 75e233dc579226d89294c3e70a921cc113eb69cc by Jonathan Poelen.
Committed on 09/08/2019 at 00:21.
Pushed by jpoelen into branch 'master'.

Latex: several fixes (math mode, nested verbatim, ...)

Summary:
- nested { and macro identifier with math mode
- add shortintertext, Cref, param with math env and fix providecommand
- text macro in math mode
- nested verbatim
- ...
Related: bug 320303

Reviewers: #framework_syntax_highlighting, dhaumann, cullmann

Reviewed By: #framework_syntax_highlighting, cullmann

Subscribers: nibags, kde-frameworks-devel, kwrite-devel

Tags: #kate, #frameworks

Differential Revision: https://phabricator.kde.org/D23013

M  +3    -3    autotests/folding/example.rmd.fold
M  +183  -6    autotests/folding/highlight.tex.fold
D  +0    -5    autotests/folding/test.tex.fold
M  +182  -5    autotests/html/highlight.tex.html
D  +0    -12   autotests/html/test.tex.html
M  +177  -0    autotests/input/highlight.tex
D  +0    -5    autotests/input/test.tex
M  +186  -9    autotests/reference/highlight.tex.ref
D  +0    -5    autotests/reference/test.tex.ref
M  +2    -2    autotests/syntaxrepository_test.cpp
M  +685  -275  data/syntax/latex.xml

https://commits.kde.org/syntax-highlighting/75e233dc579226d89294c3e70a921cc113eb69cc