Sublime Forum

Syntax highlighting deranged for JavaScript when using PHP inside JavaScript

#1

Hi guys,

Loving Sublime Text!

Wanted to let you know that I have an issue with syntax highlighting when using mixed PHP and JavaScript code as in the example below. I know some threads are open about similar issues, but they focus on PHP syntax highlighting and mine is more about JavaScript highlighting. Please have a look at it and perhaps merge with another issue if that’s the best approach.

I am using PHP inside JavaScript to set a variable and from that point on the JavaScript highlighting is broken until the end script tag.

0 Likes

Color Issues (php+js)
#2

A fix for this has already been made, and will be in the next build.* Alternatively, you can follow the instructions on the GitHub repo to use the fix in the current build.

* (Hope I’m not treading on any toes by saying that - I’m not a member of SublimeHQ, but I do contribute to the repo, and I know that the latest version of the repo is always used when a new release is made)

2 Likes

3114 syntax PHP in HTML bug :(
#3

Cool, looking forward to the fix! Will wait for the official update. Thanks! And thanks for contributing to the project :slight_smile:

0 Likes

#4

I’m having the same issue! driving me nuts haha!

0 Likes

#5

Sorry but I don’t know how to install a fix for this problem directly from GitHub repo, I see a lot of folders, but I don’t know if I need to copy those folders into my main folder or what. Can you explain it to me? Sorry too for my english :confounded:

0 Likes

#6

if you have bought a licence for ST3, you can use the latest dev version, which includes this fix already, so you won’t need to do anything extra. You can download it from https://www.sublimetext.com/3dev

2 Likes

#7

Thanks so much for your answer. I didn’t buy a license unfortunately (I only have the demo), but thanks anyway, i’ll keep waiting until I can buy a license or they release it as update to the demo version.

Thanks again for your help :slightly_smiling:

0 Likes

#8

Hei, Hello everbody.
I’m encountering this problem, also with the latest version of ST3.

Do you have any ideas how to fix it?
Thanks.

0 Likes

#9

You would need to post the full code at https://github.com/sublimehq/Packages/issues so people can look into what is happening.

0 Likes

#10

Hi, thanks for the reply.
I posted the file in this issue: https://github.com/sublimehq/Packages/issues/1168
I hope it can be usefull.

0 Likes