<?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[simple UDL highlighting Apostrophes &amp; Quotation Marks]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I copy and paste lot’s of different little text snippets to check the straight Apostrophes &amp; Quotation Marks and the ‘open and close curly’ variants.</p>
<p dir="auto">How can I give each type a different color in an UDL? (not with style tokens, cause that takes too much time)</p>
<p dir="auto">Tia</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/23774/simple-udl-highlighting-apostrophes-quotation-marks</link><generator>RSS for Node</generator><lastBuildDate>Sun, 10 May 2026 04:51:59 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/23774.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 19 Nov 2022 15:15:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to simple UDL highlighting Apostrophes &amp; Quotation Marks on Sun, 20 Nov 2022 09:13:13 GMT]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">This does exactly what I want, thank you very much.</p>
<p dir="auto">greetings,</p>
<p dir="auto">Christoph</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81780</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81780</guid><dc:creator><![CDATA[Christoph De Wolf]]></dc:creator><pubDate>Sun, 20 Nov 2022 09:13:13 GMT</pubDate></item><item><title><![CDATA[Reply to simple UDL highlighting Apostrophes &amp; Quotation Marks on Sat, 19 Nov 2022 21:13:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christoph-de-wolf" aria-label="Profile: Christoph-De-Wolf">@<bdi>Christoph-De-Wolf</bdi></a></p>
<p dir="auto">Unfortunately, ‘single’ and “double” smart quotes are at unicode codepoints beyond 255.  And the UDL doesn’t handle codepoints above 255 in the Operators &amp; Delimiters inputs… and unfortunately, that’s the most natural place.  This will be expounded in the next version of the usermanual:</p>
<blockquote>
<p dir="auto"><strong>Unicode Support</strong></p>
<p dir="auto">The UDL interface and underlying lexer was designed in the early days of Notepad++, before good Unicode support was implemented, so the User Defined Language system does not fully support Unicode characters beyond what’s available in the current ANSI codepage (255 characters). Unicode can be used in some locations, like the keywords and the Numbers-style Extras 1; but many other places, like Operators &amp; Delimiters, or Comments, or Folding, do not work with characters beyond codepoint 255. If Unicode characters in your operators or delimiters is a requirement for you, you should consider using a existing plugin (such as a scripting plugin or EnhanceAnyLexer) to add additional text highlighting based on the active langauge, or write your own plugin to add highlighting in any way you choose. (Also, if you have the coding skills necessary to update Notepad++'s codebase to allow UDL to use Unicode, without causing any regressions, you might consider submitting a PR, as it could close multiple open issues.)</p>
</blockquote>
<p dir="auto">using Keywords list in prefix mode would work for the opening quote marks, which will always be at the beginning of a word… so you could put open single ‘ in group 7 with one color, and open double “ in group 8 with a different color; if you checkmarked “prefix mode”, it will highlight the whole word that starts with that character.  But since there is no suffix mode, you cannot do the same for the end quotes ’ and ”.</p>
<p dir="auto">The plugin Enhance Any Lexer could come to your rescue, however.  Undo the Keywords for both of the open quotes.  Instead (after installing the plugin and making sure your imported file has your current UDL as the active language), <strong>Plugins &gt; Enhance Any Lexer &gt; Enhance current langauge</strong>: it will open a config file and create a new section named after your UDL: if you called it FindWeirdQuotes, you would see a new section,</p>
<pre><code>[findweirdquotes]
; color each word, 0x66ad1 is the color used, see the description above for more information on the color coding.
0x66ad1 = \w+
; check in the respective styler xml if the following IDs are valid
excluded_styles = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,20,21,22,23
</code></pre>
<p dir="auto">Go in and edit that to have four different colors mapped to the four weird quotes:</p>
<pre><code>[findweirdquotes]
; color each word, 0x66ad1 is the color used, see the description above for more information on the color coding.
0xFFFF00 = ‘
0xFF7F00 = ’
0xFF00FF = “
0xFF007F = ”
; check in the respective styler xml if the following IDs are valid
;excluded_styles = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,20,21,22,23
</code></pre>
<p dir="auto">Once you save that, any time you activate a tab that has the UDL language set to FindWeirdQuotes, it will highlight them in the four colors (bright cyan, more bluish cyan, bright magenta, darker purple were my choices)<br />
<img src="/assets/uploads/files/1668892277440-a34dc03b-5ccc-49b2-b1f3-2af6f80ed389-image.png" alt="a34dc03b-5ccc-49b2-b1f3-2af6f80ed389-image.png" class=" img-fluid img-markdown" /><br />
(You only have to do the setup once; once it’s saved, the plugin will automatically apply those colors whenever the active file is in the named UDL.)</p>
<p dir="auto">(And you can choose whether to also use the normal UDL features to color normal quotes and apostrophes, whether as operators or delimiter pairs, as those normal ones work in UDL just the way you’d expect.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81765</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81765</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 19 Nov 2022 21:13:17 GMT</pubDate></item></channel></rss>