</div> not identified as html Follow
I often use statements like:
$a = "hello world";
(Not as trivial at this example above, just more complex, but just to show...)
Ok, so phpStorm finds the <div> inside of the echoed string to be html and colors it the way I wanted it to color html...
On the other hand, the closing tag (like </div>) is not identified and colored just like plain text.
That is different behaviour when I use the opening and closing tags in one line, like:
Here the closing tag is identified and marked correctly.
Is this a bug?
Marking the closing tags to would be very helpful to get a better view of the structure while coding.
Please sign in to leave a comment.
No (at very least in my opinion)
So .. what's stopping you from doing it yourself? This feature called "Language Injection".
The echo with opening div tag is highlighted automatically because it matches the bundled pattern (Settings Language Injections --> html). There is no such pattern to match closing tag only. If you want:
Hi Andriy, thanks for your cool answer!
To be honest I did not know the feautre that I can set my own patterns. This is right what I needed, so I am sure I will find it to configure the way I need it.
But: I find it very difficult to use the help-file... I do not know what to do.
So, especially for all closing tags like </...>,
How can I configure it?
2) Language injections
3)Do I have to add generic php? Or what do I have to do?
Thank you so much!
Check php: <"html"> entry and create something similar (that will match your requirements). But yes, there is no easy to understand documentation on this particular subject (how to write such pattern) -- maybe have a look at IntelliJ IDEA help, maybe there will be something useful there.
You mean create a duplicate entry to <html> and modify it?
Try that .. or create new one from scratch.
When I needed to create one for SQL language ("EXEC stored_procedure") I just createed one fresh in a similar way how existing was done (made a screenshot of bundled one and was messing around trying to do similar thing) -- that was over a year ago .. so don't remember details.
Thanks, I will try that and give report.
No, I did not manage that. I don´t know what to write in where.
Can someone help? Thank you.
Well ... if you really want, you can try this one, although I can say it's quite inefficient (and I simply do not have much hardcoded HTML to test it to see the possible performance impact).
I expecting this to product a lot of false positives if you happen to have strings with "</" and ">" inside (pattern is too broad; therefore it will match anything with those symbols, even "Hello </mister twister > bla bla").
that one works perfectly for me, thanks!
I don´t think that I will have a lot of situation with other </ * > patterns.
If, there is a question: Is it able to set a kind of EXCLUDE pattern?
If not, is there possibility to COMBINE for example to patterns? Becuase the closing tags I use are not so much, it qould be possible then to combine </div> with </form> and </ol> and three or four more, and it will be done.
Thank you so much! That helped me a lot!
The pattern .*</.*>.* is normal regular expresion -- modify it as needed. This may work (have not tested though): .*</(div|form|ol)>.*
Thanks a lot! My coding is looking brillant now. :-)
I'm trying to use this as well. Can someone tell me why with default HTML injection this the <strong> is matched here:
but not here
Why does concatentation make it not match?
Sounds like your case:
Oh, yea, forgot about that....it's been so long since I messed with this.