PHP syntax not highliting when inside other language string (ver 7.7)
-
Php code that is written inside other laguage string is not highlighting in the latest version.
Javascript example:
var ScannerName = “<?php echo $_SERVER[‘REMOTE_ADDR’].”[WDT2]“; ?>”;
The line is interpreted as string (gray color) but php syntax should override the styling and use php coloring in between the <?php ?> tags.NP++ ver 7.6.2 works correctly
-
You’re seeing it with PHP, not ASP, but you’ll find a few recent complaints about ASP having the same difficuly; it might be the same bug (though I’m not sure / cannot prove it):
- https://notepad-plus-plus.org/community/topic/17764/defined-asp-style-disappeared-after-7-7-install
- https://notepad-plus-plus.org/community/topic/17727/update-to-7-7-ver-and-missed-asp-code-style
- https://notepad-plus-plus.org/community/topic/17696/bug-problem-with-syntax-highlighting-not-working-on-asp-classic-scripts/5
-
Yes I thought the issue is similar.
Just wanted to report that php syntax has issues as well in case it is gonna get fixed soon. -
Also having this issue, hope it gets fixed soon bc it’s super annoying.
-
this purely depends on the scintilla editor component, which is an external project.
this behaviour is the same in previous notepad++ versions like 7.6.2, unless you had 3rd party highlighting plugins, and/or scripts installed, that could eventually do so.you could try to file a feature request at the scintilla tracker, but as php code strings like
var ScannerName = "<?php echo $_SERVER['REMOTE_ADDR']."[WDT2]"; ?>";are interpreted as text as expected, due to being in between two"double quotes, i doubt that it would be accepted.note: you can always download the latest SciTE scintilla demo editor, to see any scintilla feature changes.
many thanks and best regards.
-
@Meta-Chuh
I tried various Scite editor versions (dl from https://www.npackd.org/p/scite) and for the php language and your example, nothing changed since at least v4.0.0
But I agree something has changed in Notepad++, previously the content in the php tags was highlighted.
I will download previous versions of notepad++ to compare to v7.7.1… -
@David-WZ said:
I tried various Scite editor versions (dl from https://www.npackd.org/p/scite)
Why would you obtain SciTe from anywhere but its home site? I don’t know for sure, but often this kind of thing is just asking for trouble…
Haha, just noticed that @Meta-Chuh pointed to the same site…and yet you still went out of your way to get some “questionable” version.
-
My bad, I didn’t go far enough in the past !
I’ve just seen that notepad++ v7.7 “Upgrade Scintilla from v3.56 to v4.14.”, so I tried v3.5 of Scite and the behaviour has changed…
@Meta-Chuh has right and the “problem” comes from Scintilla.
By the way, I think I will downgrade to Notepad++ v7.6.6, that will solve my problem for a while… -
-
@Ekopalypse Yes it is, I didn’t see it.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login