Bug 363186 - PHP syntax highlighting problem in comments
Summary: PHP syntax highlighting problem in comments
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: syntax (show other bugs)
Version: 16.04.1
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-17 16:40 UTC by Guo Yunhe
Modified: 2016-10-24 19:34 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: KDE Frameworks 5.27


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guo Yunhe 2016-05-17 16:40:24 UTC
http://imgur.com/F9kmCjn

When type author in comments, like:

/**
 * Classname
 *
 * @author Guo Yunhe <guoyunhe@example.com>
 */

The email address seems highlighted as HTML tags.

Reproducible: Always
Comment 1 Buovjaga 2016-07-08 18:43:25 UTC
Reproduced.

Arch Linux 64-bit
Kate 16.04.2
KDE Frameworks 5.23.0
Qt 5.7
xcb wm
Comment 2 Martin Walch 2016-08-12 08:15:20 UTC
Indeed, this seems to be handled by doxygen.xml and the email address seems to be interpreted as HTML tag in the BlockComment context, matching the rule

<RegExpr attribute="HTML Tag" context="ML_htmltag" String="&lt;\/?[a-zA-Z_:][a-zA-Z0-9._:-]*" />

So, this is not limited to php, but any language that uses the doxygen markup.

A quick fix would probably to add another rule right above with a RegExpr that matches syntactically valid email addresses. However, this would ignore the preceding name. Also, this would not match email addresses that are not enclosed in brackets <...>. I am not sure whether the last one can actually be implemented, because this might conflict with matching doxygen tags.
Comment 3 Christoph Cullmann 2016-09-06 11:54:12 UTC
Git commit ec4cf8b867b7f470c13c2df5e20dcd0e4c64397e by Christoph Cullmann.
Committed on 06/09/2016 at 11:07.
Pushed by cullmann into branch 'master'.

fix email address highlighting in doxygen

actually the fix makes the highlighting of HTML tags more "wrong" as it accepts invalid tags but that fixes e-mail addresses and stuff like that, think good enough (TM)

M  +5    -5    src/syntax/data/doxygen.xml

http://commits.kde.org/ktexteditor/ec4cf8b867b7f470c13c2df5e20dcd0e4c64397e