Skip to content

comments.xml: highlight URLs and Emails, and other improvements

comment

Add highlighting of URLs and Emails in comments (this was already present in the AppArmor and SELinux highlighters, so I moved the rules to comments.xml).

However, highlighting URLs can cause problems when detecting closing multi-line comments, so I created the "SingleLine" and "MultiLine" contexts. The idea is that in single-line comments you use:

<IncludeRules context="SingleLine##Comments"/>

And in multi-line comments use:

<IncludeRules context="MultiLine##Comments"/>

Also, this differentiation can avoid problems when closing comments in future modifications of comments.xml.

Using ##Comments (main context) only includes the essentials (##Alerts, ##Modelines & ##SPDX-Comments), without the highlighting of URLs.

The changes have been reviewed by me. Any inconvenience don't hesitate to notify.

Merge request reports

Loading