<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Custom Styles for 'Special' Comments]]></title><description><![CDATA[<p dir="auto">I have html code which has special tags embedded in comments which I would like to display in a custom style in Notepad++. I’ve tried adding these special tags to keywords or operators/delimiters in the UDL, but the comments style seems to have precedence.</p>
<p dir="auto">Is there any way to do this?</p>
<p dir="auto">Thanks,</p>
<p dir="auto">Tom</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/18295/custom-styles-for-special-comments</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Nov 2026 11:33:45 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/18295.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 25 Sep 2019 20:34:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Custom Styles for 'Special' Comments on Thu, 26 Sep 2019 14:24:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> said in <a href="/post/47369">Custom Styles for 'Special' Comments</a>:</p>
<blockquote>
<p dir="auto">So I see a conflict: do you want to use a UDL ([<strong>Language &gt; Define Your Language</strong>](<a href="https://npp-user-manual.org/docs/user-" rel="nofollow ugc">https://npp-user-manual.org/docs/user-</a><br />
If using the builtin HTML lexer, unfortunately <strong>Settings &gt; Style Configurator &gt; HTML</strong> dialog doesn’t seem to list any styles that have user-defined keywords.  And even if you could, I think comments would override that.</p>
</blockquote>
<p dir="auto">I was hoping to simply modify the built in HTML lexer. Thanks for confirming that that is not possible.</p>
<blockquote>
<p dir="auto">However, there are workarounds:</p>
<ul>
<li>you can add extra highlighting to a builtin lexer (like the HTML lexer) using regexes via the script <code>EnhanceAnyBuiltinLexer.py</code> that <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> shares, <a href="https://notepad-plus-plus.org/community/topic/17283/perl-language-syntax-highlighting-troubles-bug-or-limitation/111" rel="nofollow ugc">in this linked post</a></li>
<li>you can add extra highlighting to a UDL language using regexes via the script <code>EnhanceUDLLexer.py</code> that <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> shares <a href="https://notepad-plus-plus.org/community/topic/17134/enhance-udl-lexer/31" rel="nofollow ugc">in this linked post</a></li>
</ul>
</blockquote>
<p dir="auto">I will check these out, but regex is usually challenging for me. I’ll give it a go.</p>
<p dir="auto">Thanks again,</p>
<p dir="auto">Tom Benedict</p>
]]></description><link>https://community.notepad-plus-plus.org/post/47371</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/47371</guid><dc:creator><![CDATA[Thomas Benedict]]></dc:creator><pubDate>Thu, 26 Sep 2019 14:24:28 GMT</pubDate></item><item><title><![CDATA[Reply to Custom Styles for 'Special' Comments on Wed, 25 Sep 2019 21:46:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/thomas-benedict" aria-label="Profile: Thomas-Benedict">@<bdi>Thomas-Benedict</bdi></a> said in <a href="/post/47368">Custom Styles for 'Special' Comments</a>:</p>
<blockquote>
<p dir="auto">I have html code which has special tags embedded in comments which I would like to display in a custom style in Notepad++. I’ve tried adding these special tags to keywords or operators/delimiters in the UDL</p>
</blockquote>
<p dir="auto">So I see a conflict: do you want to use a UDL (<a href="https://npp-user-manual.org/docs/user-defined-language-system/" rel="nofollow ugc"><strong>Language &gt; Define Your Language</strong></a>) for styling HTML, or the builtin HTML lexer (<a href="https://npp-user-manual.org/docs/preferences/#style-configurator" rel="nofollow ugc"><strong>Settings &gt; Style Configurator &gt; HTML</strong></a>)?  The two don’t mix: you can have only one active lexer at a time.</p>
<p dir="auto">If as a UDL, there are nuances that you will lose, but you can define any keywords you want, in multiple groups.  And you can set the comment syntax so that it allows nesting of other keyword groups that you want.  See the <a href="https://npp-user-manual.org/docs/user-defined-language-system/" rel="nofollow ugc">UDL section in the usermanual</a></p>
<p dir="auto">If using the builtin HTML lexer, unfortunately <strong>Settings &gt; Style Configurator &gt; HTML</strong> dialog doesn’t seem to list any styles that have user-defined keywords.  And even if you could, I think comments would override that.</p>
<p dir="auto">However, there are workarounds:</p>
<ul>
<li>you can add extra highlighting to a builtin lexer (like the HTML lexer) using regexes via the script <code>EnhanceAnyBuiltinLexer.py</code> that <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> shares, <a href="https://notepad-plus-plus.org/community/topic/17283/perl-language-syntax-highlighting-troubles-bug-or-limitation/111" rel="nofollow ugc">in this linked post</a></li>
<li>you can add extra highlighting to a UDL language using regexes via the script <code>EnhanceUDLLexer.py</code> that <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> shares <a href="https://notepad-plus-plus.org/community/topic/17134/enhance-udl-lexer/31" rel="nofollow ugc">in this linked post</a></li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/47369</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/47369</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 25 Sep 2019 21:46:31 GMT</pubDate></item></channel></rss>