| Summary: | LaTeX highlighter ignores \end{equation} in corner cases. | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-syntax-highlighting | Reporter: | pbs3141 |
| Component: | syntax | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 5.63.0 | ||
| Target Milestone: | --- | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| Latest Commit: | https://commits.kde.org/syntax-highlighting/467bea3525cc5fde844ef6ca4d56fd68c7df9e05 | Version Fixed/Implemented In: | 5.64.0 |
| Sentry Crash Report: | |||
| Attachments: | Screenshot of two examples | ||
|
Description
pbs3141
2019-10-27 00:12:23 UTC
Created attachment 123505 [details]
Screenshot of two examples
% Good
\begin{equation}2 \end{equation}
% Bad
\begin{equation}2\end{equation}
Please feel free to ignore the previous two comments I accidentally created, *THIS* is the actual bug report.
SUMMARY
The LaTeX highlighter ignores \end{equation} in certain corner cases, making it highlight the rest of the document in maths mode.
STEPS TO REPRODUCE
Load this into kate and pick LaTeX as the language:
% Good
\begin{equation}2 \end{equation}
% Bad
\begin{equation}2\end{equation}
OBSERVED RESULT
The second line has \end in blue and {equation} in orange.
EXPECTED RESULT
Both lines should be highlighted the same.
Git commit 467bea3525cc5fde844ef6ca4d56fd68c7df9e05 by Nibaldo González.
Committed on 05/11/2019 at 02:09.
Pushed by ngonzalez into branch 'master'.
LaTeX: fix backslash delimiter in some keywords
Summary:
FIXED-IN: 5.64.0
A delimiter before keywords of kind `\command` isn't required. Therefore, a DetectChar rule with lookAhead is used to detect `\` at the beginning of the keywords, and thus avoid the delimiter in the keyword.
{F7733046}
Reviewers: #framework_syntax_highlighting, dhaumann, cullmann, jpoelen
Reviewed By: #framework_syntax_highlighting, cullmann
Subscribers: kwrite-devel, kde-frameworks-devel
Tags: #kate, #frameworks
Differential Revision: https://phabricator.kde.org/D25139
M +9 -0 autotests/folding/highlight.tex.fold
M +9 -0 autotests/html/highlight.tex.html
M +9 -0 autotests/input/highlight.tex
M +9 -0 autotests/reference/highlight.tex.ref
M +38 -16 data/syntax/latex.xml
https://commits.kde.org/syntax-highlighting/467bea3525cc5fde844ef6ca4d56fd68c7df9e05
|