HTML injection - weird formatting

Is there a way to make injected html appear the same in the JS file(top) as it currently does in the html fragment editor(bottom)?

0
1 comment

Try annotating the injection with comment (see https://www.jetbrains.com/help/webstorm/using-language-injections.html#injection_comments) - does it help?

When implementing formatting inside strings, our intention was to avoid changing the runtime behavior of code, so formatting is disabled unless the string is marked as 'safe' to reformat with a comment (//language=HTML):

//language=HTML
const div = `
<div>
</div>
`

We have been requested and are planning to invert the default in a future version - reformat unless specifically excluded. See WEB-30883

0

Please sign in to leave a comment.