Pattern for inject html in js

Where i can find description how i should write "places patterns"?

Or someone can write for me pattern for detect html in js?

For example

const template = `

  <div></div>

`

 

0
3 comments

these patterns are platform internals... see https://www.jetbrains.com/help/webstorm/2017.1/language-injection-settings-dialog-generic-javascript.html:

 The rules are built from Program Structure Interface Patterns and are actually chained calls of methods of an internal WebStorm language. The Program Structure Interface shows the structure of a file as WebStorm treats it.

These rules are WebStorm internals, and it is strongly recommended that you use the predefined injection configurations and avoid creating new ones.

see also https://blog.jetbrains.com/idea/2009/11/psi-viewer/.
Note that PSI Structure view is not available in WebStorm by default, it's an internal feature that can be enabled by adding -Didea.is.internal=true to .vmoptions: Help | Edit Custom VM options, append this property to the list

Why do you need it, BTW? HTML is auto-injected in template strings like

const template = `

  <div></div>

`

0
Avatar
Permanently deleted user

Thx Elena Pogorelova! I dont know why but some time auto-injected doesnt work.  And work only with // language=HTML

0

If it doesn't work in certain cases, this means that the IDE has failed to detect that the template string is HTML

0

Please sign in to leave a comment.