Embedded php syntax styles not showing in javascript


#1

Just started using atom and have been creating my own syntax theme. I’ve noticed that when php is embedded in javascript (and not in quotes) is doesn’t show any of the assigned styles.

From what I can see, unless the<?php ?> tags are encased in quote makes, Atom does not generate the classes embedded begin php.

Is this a bug or just something that Atom does not support? You can see from the attached screen shot that it is difficult to read the php sections properly.

I’ve tested this with all the standard Atom themes and the result is the same.


#2

I don’t believe that the JavaScript syntax is designed to recognize PHP mixed in with the JavaScript code.


#3

That’s a shame. Gonna make it really difficult to spot syntax errors quickly :disappointed:


#4

The way Ruby on Rails works is there is a special extension for when Ruby is embedded in other languages. This makes it much easier for grammars to know when they need to apply. For example:

  • .html.erb — HTML with Ruby embedded
  • .js.erb — JavaScript with Ruby embedded
  • etc

#5

So is there something similar for javascript and jquery?


#6

Not that I know of, though you could start a trend :grinning:


#7

Nice thread! I actually just posted an issue that might be related: https://github.com/atom/language-php/issues/176