<?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[Bug, javascript multiline character (&#96;) not understood by notepad++]]></title><description><![CDATA[<p dir="auto">Hello, so I have this javscript code that makes the following not recognized:</p>
<p dir="auto">html=‘&lt;html&gt;&lt;head&gt;&lt;title&gt;’ + document.title  + ‘&lt;/title&gt;’;<br />
html+=`&lt;style&gt;&lt;?php print $style; ?&gt;&lt;/style&gt;`;<br />
html+=‘&lt;/head&gt;&lt;body style=“margin:10px”&gt;’;</p>
<p dir="auto">After the first ` the colors are not as them should.</p>
<p dir="auto">Thanks to solve that bug.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/16164/bug-javascript-multiline-character-not-understood-by-notepad</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 23:08:34 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/16164.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 12 Aug 2018 06:21:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bug, javascript multiline character (&#96;) not understood by notepad++ on Thu, 20 Sep 2018 17:30:49 GMT]]></title><description><![CDATA[<p dir="auto">Yes separate files is better but I’m working on a customer existing project and don’t have to rewrite/optimize it.<br />
Thanks for the suggestion.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/34973</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34973</guid><dc:creator><![CDATA[Gregory D.]]></dc:creator><pubDate>Thu, 20 Sep 2018 17:30:49 GMT</pubDate></item><item><title><![CDATA[Reply to Bug, javascript multiline character (&#96;) not understood by notepad++ on Thu, 20 Sep 2018 13:48:41 GMT]]></title><description><![CDATA[<p dir="auto">Another alternative, which you’re also likely to reject, is to keep the PHP and JS in separate files, using <code>&lt;script type="text/javascript" src="external.js"&gt;&lt;/script&gt;</code> to call the JS from the PHP.  Then, when editing the PHP, it would automatically apply the PHP lexer, and when editing the JS, it would automatically apply the JS lexer.</p>
<p dir="auto">Otherwise, I’m sorry we weren’t able to help you in a way that worked for you.</p>
<p dir="auto">========================================</p>
<p dir="auto">And, regarding the pythonscript-based lexing: I know you aren’t intesterested, but to make it a bit easier for future readers of this thread, in case they <em>are</em> interested in pursuing the custom-lexer, I did a search for recent posts by <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3662">@Claudia-Frank</a> about her various custom lexers written in PythonScript:</p>
<ul>
<li>2018-08-09    <a href="https://notepad-plus-plus.org/community/topic/16125/colored-keywords-in-xml/12" rel="nofollow ugc">Colored keywords in XML</a></li>
<li>2018-08-14    <a href="https://notepad-plus-plus.org/community/topic/16088/does-the-udl-miss-the-ablity-to-recognize-methods-and-classes/15" rel="nofollow ugc">Does the UDL miss the ablity to recognize methods and classes?</a></li>
<li>2018-08-27    <a href="https://notepad-plus-plus.org/community/topic/16216/define-custom-syntax-hilighting-with-pythonscript-plugin/7" rel="nofollow ugc">Define custom syntax hilighting with pythonscript plugin</a></li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/34969</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34969</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 20 Sep 2018 13:48:41 GMT</pubDate></item><item><title><![CDATA[Reply to Bug, javascript multiline character (&#96;) not understood by notepad++ on Thu, 20 Sep 2018 13:28:05 GMT]]></title><description><![CDATA[<p dir="auto">OK, thank you for that detailed explanation, I think I won’t have time to try to understand how to create a python script to create a custom lexer. I made a try but can’t find how to change the text color, just underline…<br />
Also adding php extension to javascript list or changing each time from one to another doesn’t looks like a solution, so never mind.</p>
<p dir="auto">Thanks you for your time.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/34968</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34968</guid><dc:creator><![CDATA[Gregory D.]]></dc:creator><pubDate>Thu, 20 Sep 2018 13:28:05 GMT</pubDate></item><item><title><![CDATA[Reply to Bug, javascript multiline character (&#96;) not understood by notepad++ on Wed, 19 Sep 2018 19:29:57 GMT]]></title><description><![CDATA[<p dir="auto">Excerpt from my stylers.xml:</p>
<pre><code>    &lt;LexerType name="javascript.js" desc="JavaScript" ext=""&gt;
        &lt;WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /&gt;
        &lt;WordsStyle name="INSTRUCTION WORD" styleID="5" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" keywordClass="instre1" /&gt;
        &lt;WordsStyle name="TYPE WORD" styleID="16" fgColor="8000FF" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" keywordClass="type1" /&gt;
        &lt;WordsStyle name="WINDOW INSTRUCTION" styleID="19" fgColor="804000" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" keywordClass="instre2" /&gt;
        &lt;WordsStyle name="NUMBER" styleID="4" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /&gt;
        &lt;WordsStyle name="STRING" styleID="6" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /&gt;
        &lt;WordsStyle name="STRINGRAW" styleID="20" fgColor="000080" bgColor="C0C0C0" fontName="" fontStyle="0" fontSize="" /&gt;
        &lt;WordsStyle name="CHARACTER" styleID="7" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /&gt;
        &lt;WordsStyle name="OPERATOR" styleID="10" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" /&gt;
        &lt;WordsStyle name="VERBATIM" styleID="13" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /&gt;
        &lt;WordsStyle name="REGEX" styleID="14" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" /&gt;
        &lt;WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /&gt;
        &lt;WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /&gt;
        &lt;WordsStyle name="COMMENT DOC" styleID="3" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /&gt;
        &lt;WordsStyle name="COMMENT LINE DOC" styleID="15" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /&gt;
        &lt;WordsStyle name="COMMENT DOC KEYWORD" styleID="17" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" /&gt;
        &lt;WordsStyle name="COMMENT DOC KEYWORD ERROR" styleID="18" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /&gt;
    &lt;/LexerType&gt;
</code></pre>
<p dir="auto">This is what I would have suggested, if I hadn’t found and confirmed what I realized while typing step 7 below.  Before trying this, move down to the <strong>WHOOPS</strong> section.</p>
<p dir="auto"><s>My next debug suggestion:</s></p>
<ol>
<li>Close all open instances of Notepad++</li>
<li>Use Windows Explorer and go to <code>%AppData%\Notepad++</code> (you can just paste that into the address bar)</li>
<li>Copy <code>stylers.xml</code> to <code>keep-stylers.xml</code></li>
<li>Edit <code>stylers.xml</code>: remove your “javascript.js” `&lt;LexerType&gt;, and replace it with my excerpt</li>
<li>Save <code>stylers.xml</code></li>
<li>Close all open instances of Notepad++</li>
<li>Open your example <code>test.js</code>… (see <strong>WHOOPS</strong> below):</li>
<li>Manually Selct <strong>Settings &gt; Style Configurator &gt; Select theme : “Default (stylers.xml)”</strong></li>
<li>It should have selected Javascript: “JavaScript file” should be in the lower-left of the status bar, and <strong>Language</strong> menu should show JavaScript selected</li>
</ol>
<p dir="auto"><s>Under these <em>Exact</em> circumstances, what do you get?</s></p>
<h2>WHOOPS</h2>
<p dir="auto">I just noticed while typing this up that your file is named “test.php”, <em>not</em> “test.js”.  Which means it’s likely selecting the PHP Lexer, not the Javascript Lexer.  This would have been useful information at the start.</p>
<p dir="auto">When I take my example .js file, and manually select <strong>Language &gt; PHP</strong>, then like you, I don’t get differentiated styling.  But if I manually go back to <strong>Languages &gt; Javascript</strong>, I get back the correct highlighting.</p>
<p dir="auto">Further, if I save the file as .php instead, and load it in NPP, then it defaults to the PHP lexer, and gives formatting similar to what you describe.</p>
<h2>LESSON</h2>
<p dir="auto">The lesson is: it will apply the PHP lexer to PHP files.  There isn’t (by default)  a mixed lexer that will highlight both JS and PHP (or HTML+JS, or …) simultaneously.  That would require a custom lexer.  If you want to temporary apply JS lexer, you have to manually select it.  If you want to always apply the JS lexer to PHP files, then use the <strong>Style Configurator</strong> and add <code>php</code> to the <strong>User Ext</strong> list for <strong>JavaScript</strong></p>
<h2>BUG</h2>
<p dir="auto">So, expecting PHP to <em>properly</em> parse and <em>highlight</em> JS is a poor expectation on the user’s part (IMO).</p>
<p dir="auto">But having the PHP parser get confused if there is embedded JS in PHP does seem like a bug in the PHP parser, to me.</p>
<p dir="auto">If you want to report <em>that</em> bug on the PHP lexer (that embedded javascript in PHP will mess up the PHP lexing), then you may do that.  I believe that the PHP lexer is under the control of the Scintilla editor; it has it’s own <a href="https://sourceforge.net/p/scintilla/bugs/" rel="nofollow ugc">bug tracker</a>.  But you should be forewarned: Notepad++ is somewhat behind in its version of scintilla (it doesn’t upgrade the scintilla component every time that the Scintilla project releases), so it may be that they’ve already fixed that bug; you can go through their bug tracker yourself and see.  Also, even if Scintilla does fix it, there is no guarantee that the lexer will be updated in Notepad++, so the bug may stay around for a while.</p>
<p dir="auto">That said, you can use the workaround of manually selecting JavaScript language from the <strong>Language</strong> menu while you are editing the JS portions of your PHP.</p>
<h2>Possibility</h2>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3662">@Claudia-Frank</a> has written up some code to create a custom lexer in PythonScript, which if I remember correctly allows you to do custom lexing with features that the builtin lexers don’t implement, but that UDL isn’t sufficient to handle.  You can search the forum for her posts with “lexer” (and may find it), or wait to see if she chimes in after being @-mentioned.  But you might be able to  get it working to lex both PHP and JS in the same file.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/34963</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34963</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 19 Sep 2018 19:29:57 GMT</pubDate></item><item><title><![CDATA[Reply to Bug, javascript multiline character (&#96;) not understood by notepad++ on Wed, 19 Sep 2018 16:13:52 GMT]]></title><description><![CDATA[<p dir="auto">Notepad++ v7.5.8   (32-bit)<br />
Build time : Jul 23 2018 - 02:03:53<br />
Path : C:\Program Files (x86)\Notepad++\notepad++.exe<br />
Admin mode : OFF<br />
Local Conf mode : OFF<br />
OS : Windows 10 (64-bit)<br />
Plugins : ComparePlugin.dll DSpellCheck.dll mimeTools.dll NppConverter.dll NppExport.dll</p>
<p dir="auto">I have the same issue with any theme.<br />
One thing to note, in the style configurator, in Language “Javascript” I can change any color and nothing happen, only javascript (embedded) works, maybe it can help.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/34959</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34959</guid><dc:creator><![CDATA[Gregory D.]]></dc:creator><pubDate>Wed, 19 Sep 2018 16:13:52 GMT</pubDate></item><item><title><![CDATA[Reply to Bug, javascript multiline character (&#96;) not understood by notepad++ on Wed, 19 Sep 2018 15:30:57 GMT]]></title><description><![CDATA[<p dir="auto">The bug isn’t present in my Notepad++ v5.7.8 32-bit with the default styler selected.  You are going to have to give us more to go on to try to replicate the bug.</p>
<p dir="auto"><img src="https://camo.nodebb.org/dde751787b092bf2b7e3edf75914b5c4a319b12a?url=https%3A%2F%2Fi.imgur.com%2FM6oCiO7.png" alt="Imgur" class=" img-fluid img-markdown" /></p>
<p dir="auto">I actually edited the default style temporarily so that each of the three (STRING, STRINGRAW, and CHARACTER) use different backgrounds, to be obvious.</p>
<p dir="auto">My <strong>? &gt; Debug Info</strong> is</p>
<pre><code class="language-z">Notepad++ v7.5.8   (32-bit)
Build time : Jul 23 2018 - 02:03:53
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS : Windows 10 (64-bit)
Plugins : ComparePlugin.dll dbgpPlugin.dll MarkdownViewerPlusPlus.dll NppExec.dll NppFTP.dll PluginManager.dll PreviewHTML.dll PythonScript.dll XMLTools.dll DSpellCheck.dll mimeTools.dll NppConverter.dll NppExport.dll 
</code></pre>
<p dir="auto">Could you paste your <strong>? &gt; Debug Info</strong>, as well as what styler you have selected.  If you switch to the default styler, possibly with background changes for the (STRING, STRINGRAW, and CHARACTER) to make it obvious which is highlighted, do you see something similar to mine?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/34956</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34956</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 19 Sep 2018 15:30:57 GMT</pubDate></item><item><title><![CDATA[Reply to Bug, javascript multiline character (&#96;) not understood by notepad++ on Wed, 19 Sep 2018 14:14:10 GMT]]></title><description><![CDATA[<p dir="auto">Sorry for the delay , I don’t receive notifications… but still have the bug.<br />
Yes it’s a bug because the code works but the display is wrong, here is a screen shot of a very simple code:</p>
<p dir="auto"><img src="https://camo.nodebb.org/ca03c24933013915d90c3e5cc3bf0008682706cb?url=https%3A%2F%2Flinkall.pro%2FGreg.jpg" alt="Alt text" title="Optional title attribute" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/34954</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34954</guid><dc:creator><![CDATA[Gregory D.]]></dc:creator><pubDate>Wed, 19 Sep 2018 14:14:10 GMT</pubDate></item><item><title><![CDATA[Reply to Bug, javascript multiline character (&#96;) not understood by notepad++ on Tue, 11 Sep 2018 14:45:07 GMT]]></title><description><![CDATA[<p dir="auto">Did you notice that <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/34">@dail</a> posted a screenshot (embedding the image using the syntax <code>![](https://i.imgur.com/6pPEadP.jpg)</code>).  <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/34">@dail</a>’s renders correctly (ie, the way I would expect).  If yours is not rendering the way you expect, you will need to show us <em>exactly</em> what you use: embedding a screenshot would help; it would also help if you’d paste the exact code in a code block (add a blank line before and after your pasted text, and indent each line by 4 spaces, which will make sure that the forum doesn’t re-interpret your codes when rendering the post)</p>
<p dir="auto">When I take the exact text you pasted before,</p>
<pre><code>html=’&lt;html&gt;&lt;head&gt;&lt;title&gt;’ + document.title + ‘&lt;/title&gt;’;
html+=`&lt;style&gt;&lt;?php print $style; ?&gt;&lt;/style&gt;`;
html+=’&lt;/head&gt;&lt;body style=“margin:10px”&gt;’;
</code></pre>
<p dir="auto"><img src="https://camo.nodebb.org/7d5b16be4a969662eaa21fcf7d5b24ac7cd51acb?url=https%3A%2F%2Fi.imgur.com%2F7BgDa2Q.png" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">it does not mark the first line or third line as text, but does highlight the second as STRINGRAW.</p>
<p dir="auto">If I change all your smart quotes to the normal single-quotes and double-quotes,</p>
<pre><code>html='&lt;html&gt;&lt;head&gt;&lt;title&gt;' + document.title + '&lt;/title&gt;';
html+=`&lt;style&gt;&lt;?php print $style; ?&gt;&lt;/style&gt;`;
html+='&lt;/head&gt;&lt;body style="margin:10px"&gt;';
</code></pre>
<p dir="auto"><img src="https://camo.nodebb.org/7d0126e5b0501666fce22c55bff75970e7bfbe20?url=https%3A%2F%2Fi.imgur.com%2Fs04SsoM.png" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Then it renders with the first and third lines marked as STRING, and the second still as STRINGRAW</p>
<p dir="auto">If I change all the single quotes to back-ticks, like <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/34">@dail</a> showed,</p>
<pre><code>html=`&lt;html&gt;&lt;head&gt;&lt;title&gt;` + document.title + `&lt;/title&gt;`;
html+=`&lt;style&gt;&lt;?php print $style; ?&gt;&lt;/style&gt;`;
html+=`&lt;/head&gt;&lt;body style="margin:10px"&gt;`;
</code></pre>
<p dir="auto"><img src="https://camo.nodebb.org/67c173a0082e9673d93504327c904a4357aa6fef?url=https%3A%2F%2Fi.imgur.com%2F6pPEadP.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">I get it to render similar to <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/34">@dail</a>, with all three lines as STRINGRAW (used <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/34">@dail</a>’s image)</p>
<p dir="auto">All three of these conditions are exactly what I’d expect.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/34756</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34756</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 11 Sep 2018 14:45:07 GMT</pubDate></item><item><title><![CDATA[Reply to Bug, javascript multiline character (&#96;) not understood by notepad++ on Tue, 11 Sep 2018 14:10:27 GMT]]></title><description><![CDATA[<p dir="auto">I just saw your reply.<br />
Your code is the same for the second line and this is the one which cause a problem.<br />
Anyway there’s a bug as my code works but displays wrong.<br />
Is there a place to post bugs ?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/34753</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34753</guid><dc:creator><![CDATA[Gregory D.]]></dc:creator><pubDate>Tue, 11 Sep 2018 14:10:27 GMT</pubDate></item><item><title><![CDATA[Reply to Bug, javascript multiline character (&#96;) not understood by notepad++ on Mon, 13 Aug 2018 16:02:05 GMT]]></title><description><![CDATA[<p dir="auto">If I modify the text your pasted to actually use grave accent characters and normal ASCII quotation marks then I get this:</p>
<p dir="auto"><img src="https://camo.nodebb.org/67c173a0082e9673d93504327c904a4357aa6fef?url=https%3A%2F%2Fi.imgur.com%2F6pPEadP.jpg" alt="" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/34110</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34110</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Mon, 13 Aug 2018 16:02:05 GMT</pubDate></item></channel></rss>