Bug 413493

Summary: LaTeX highlighter ignores \end{equation} in corner cases.
Product: [Frameworks and Libraries] frameworks-syntax-highlighting Reporter: pbs3141
Component: syntaxAssignee: 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: Version Fixed In: 5.64.0
Sentry Crash Report:
Attachments: Screenshot of two examples

Description pbs3141 2019-10-27 00:12:23 UTC
SUMMARY


STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 pbs3141 2019-10-27 00:19:25 UTC
Created attachment 123505 [details]
Screenshot of two examples

% Good
\begin{equation}2 \end{equation}

% Bad
\begin{equation}2\end{equation}
Comment 2 pbs3141 2019-10-27 00:30:22 UTC
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.
Comment 3 Nibaldo G. 2019-11-05 02:10:02 UTC
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