<?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[JSON Styles Broken on v7.9.1]]></title><description><![CDATA[<p dir="auto">I just installed 7.9.1 (brand new install on a brand new installation of Windows 10) and found that the styles for JSON files are eye-searingly broken. Is this a known issue? Is there a fix?</p>
<p dir="auto"><img src="/assets/uploads/files/1608163307329-1f04bdf0-5137-442c-85de-8a488f8061b7-image.png" alt="1f04bdf0-5137-442c-85de-8a488f8061b7-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/topic/20480/json-styles-broken-on-v7-9-1</link><generator>RSS for Node</generator><lastBuildDate>Thu, 10 Sep 2026 22:16:27 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/20480.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 17 Dec 2020 00:02:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to JSON Styles Broken on v7.9.1 on Thu, 17 Dec 2020 08:38:09 GMT]]></title><description><![CDATA[<p dir="auto">Just to add to that, JSON by design does not have comments. It is a data only file type. Some if not most parsers error upon finding comments, so I guess Notepad++ is right here.</p>
<p dir="auto">See also <a href="https://stackoverflow.com/questions/244777/can-comments-be-used-in-json" rel="nofollow ugc">https://stackoverflow.com/questions/244777/can-comments-be-used-in-json</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/60873</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60873</guid><dc:creator><![CDATA[Daniel Fuchs]]></dc:creator><pubDate>Thu, 17 Dec 2020 08:38:09 GMT</pubDate></item><item><title><![CDATA[Reply to JSON Styles Broken on v7.9.1 on Thu, 17 Dec 2020 00:22:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/clonkex" aria-label="Profile: Clonkex">@<bdi>Clonkex</bdi></a> ,</p>
<p dir="auto">Actually, this sounded like a familiar question, so I searched for “JSON comment” in this forum, and found <a href="/topic/19486">this earlier discussion</a>.</p>
<p dir="auto">If you use PythonScript, you can use <code>editor.setProperty("lexer.json.allow.comments",1)</code> in your <a href="http://startup.py" rel="nofollow ugc">startup.py</a> to always enable JSON comments, those comments will properly highlight:</p>
<p dir="auto"><img src="/assets/uploads/files/1608164490917-c12978b2-5102-48fe-8c7c-be7f84ceeceb-image.png" alt="c12978b2-5102-48fe-8c7c-be7f84ceeceb-image.png" class=" img-fluid img-markdown" />  becomes <img src="/assets/uploads/files/1608164520631-8471ef8e-6ee8-44e6-96c4-95221b6a5281-image.png" alt="8471ef8e-6ee8-44e6-96c4-95221b6a5281-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">AFAIK, no one followed my advice of submitting a feature request to have Notepad++ provide that option.  If you do put in that feature request (I even gave potential text for the request in that other topic), if you could link the issue you create both in this topic and that one, that way future readers can see how it progressed.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60871</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60871</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 17 Dec 2020 00:22:08 GMT</pubDate></item><item><title><![CDATA[Reply to JSON Styles Broken on v7.9.1 on Thu, 17 Dec 2020 00:14:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/clonkex" aria-label="Profile: Clonkex">@<bdi>Clonkex</bdi></a>,</p>
<p dir="auto">The JSON parser, inherited from the Scintilla library, despite claiming to support LINECOMMENT and BLOCKCOMMENT styles, interprets comments as errors, so applies the ERROR style to such text.</p>
<p dir="auto">Your choices are</p>
<ol>
<li><a href="https://www.scintilla.org/ScintillaToDo.html" rel="nofollow ugc">ask and wait for Scintilla to fix that bug</a>, then <a href="/topic/15741">ask and wait for Notepad++ to upgrade its internal Scintilla version</a>.</li>
<li>workaround: using the PythonScript plugin, you can add extra highlighting to a builtin lexer (like the JSON lexer) using regexes via the script <code>EnhanceAnyLexer.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://github.com/Ekopalypse/NppPythonScripts/blob/master/npp/EnhanceAnyLexer.py" rel="nofollow ugc">in his github repo</a> .  So you could use a regex like <code>//.*$</code> and apply some other style values.</li>
<li>change the ERROR styling to be similar to the comment style – maybe use a slightly different color, so if the line really is an error, you will still see it.</li>
</ol>
]]></description><link>https://community.notepad-plus-plus.org/post/60870</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60870</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 17 Dec 2020 00:14:25 GMT</pubDate></item></channel></rss>