Bug 398717 - Syntax highlighting of email is broken by unclosed parenthesis in header line
Summary: Syntax highlighting of email is broken by unclosed parenthesis in header line
Status: RESOLVED FIXED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (show other bugs)
Version: 5.46.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-16 13:14 UTC by Erik Quaeghebeur
Modified: 2018-09-16 18:10 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.51


Attachments
Test case (333 bytes, message/rfc822)
2018-09-16 13:14 UTC, Erik Quaeghebeur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Quaeghebeur 2018-09-16 13:14:58 UTC
Created attachment 115012 [details]
Test case

If there is an unbroken parenthesis in the header line of an email, then everything that follows is commented (gray). While it is true that parentheses enclose comments in most header fields, this does not hold for all fields, e.g., not for Subject. So some extra care needs to be taken to avoid erroneous interpretation as a comment there (and perhaps other fields).

Maybe special-casing Subject and breaking of comment-color at the end of the header is the solution.
Comment 1 Dominik Haumann 2018-09-16 18:10:13 UTC
Git commit b1da54ab91e331fdecbe07a9f40a9c1908143a4b by Dominik Haumann.
Committed on 16/09/2018 at 18:10.
Pushed by dhaumann into branch 'master'.

Fix: Email highlighting for unclosed parenthesis in Subject header

Summary:
Unfortunately, the "Subject:" header needs to be treated independently
of the other headers, since it may contain arbitrary text such as paranthesis
that is not a comment or similar. The fix is to add another context without
the comment highlighting.

Test Plan: make test

Reviewers: vkrause

Reviewed By: vkrause

Subscribers: kwrite-devel, kde-frameworks-devel

Tags: #kate, #frameworks

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

M  +2    -2    autotests/folding/test.eml.fold
M  +2    -2    autotests/html/test.eml.html
M  +2    -2    autotests/input/test.eml
M  +2    -2    autotests/reference/test.eml.ref
M  +7    -1    data/syntax/email.xml

https://commits.kde.org/syntax-highlighting/b1da54ab91e331fdecbe07a9f40a9c1908143a4b