Bug 418979 - Wrong LaTeX syntax highlighting after braces in optional argument of \cite
Summary: Wrong LaTeX syntax highlighting after braces in optional argument of \cite
Status: RESOLVED FIXED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (show other bugs)
Version: 5.68.0
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 419484 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-03-18 06:38 UTC by mail
Modified: 2020-05-05 19:31 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.69.0


Attachments
Screenshot of the wrong highlighting. (10.78 KB, image/png)
2020-03-18 06:38 UTC, mail
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mail 2020-03-18 06:38:26 UTC
Created attachment 126863 [details]
Screenshot of the wrong highlighting.

SUMMARY
If a cite command with () inside the optional argument
is used, all text is highlighted thereafter.

STEPS TO REPRODUCE
1. Open a new document.
2. Enable LaTeX syntax highlighting (Tools->Highlighting->Markup->LaTeX).
3. Add the following text.
    Text should be black.
    \cite[eq. 1.1]{some_reference}
    After a reference without braces inside [...],
    everything is fine.
    \cite[eq. (1.1)]{some_reference}
    Now, the text goes on in orange forever...

OBSERVED RESULT
"(1.1)]{some_reference}" and "Now, the text goes on in orange forever..."
are highlighted in orange.

EXPECTED RESULT
"(1.1)]{some_reference}" and "Now, the text goes on in orange forever..."
are not highlighted.


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

ADDITIONAL INFORMATION
Comment 1 Christoph Cullmann 2020-03-26 15:48:40 UTC
Git commit 213d4bb197a3d86c053a5f9a2d31a665f0864602 by Christoph Cullmann, on behalf of Nibaldo González.
Committed on 26/03/2020 at 15:48.
Pushed by cullmann into branch 'master'.

LaTeX: fix math parentheses in optional labels

Summary:

Single parentheses within `[...]` were highlighted as math text, but the math text is `\(...\)`.

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/D28303

M  +4    -0    autotests/folding/highlight.tex.fold
M  +4    -0    autotests/html/highlight.tex.html
M  +4    -0    autotests/input/highlight.tex
M  +4    -0    autotests/reference/highlight.tex.ref
M  +4    -4    data/syntax/latex.xml

https://commits.kde.org/syntax-highlighting/213d4bb197a3d86c053a5f9a2d31a665f0864602
Comment 2 Nibaldo G. 2020-05-05 04:26:04 UTC
*** Bug 419484 has been marked as a duplicate of this bug. ***