Syntax highlighting does not work for script tag with non-standard attribute Follow
Hello everyone,
I have search several similar posts but did not find a solution for my problem. My script-tag inside an html file has two additional attributes and looks like this:
<script cam-script type="text/form-script">
var cfg_frontend = camForm.variableManager.variable("cfg_frontend").value;
// [...]
Inside this script tag, syntax highlighting does not work. I have also tried the context action "inject language" -> "javascript" but this did not change anything. I would like IntelliJ to treat this script tags as if they were standard javascript tags. Is that possible with IntelliJ Ultimate?
Thanks and regards
Dierk
Please sign in to leave a comment.
Hi there,
Works for me:
The Language Injection rule (a copy of standard "script" rule but with extra rule for the "type" attribute):
PhpStorm 2021.3.1 on Windows 10, x64
see also https://intellij-support.jetbrains.com/hc/en-us/community/posts/360007657120/comments/360001434600
I created the injection like explained in the screenshot above, but the syntax highlighting does not work. Creating a xml tag injection like explained in the other post does not work, the menu entry for xml tag injections is disabled: