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.
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