Inspection on injections

I have javascript templates for html and javascript bundled together like this:

     <% if(test === true) { %>
     <p>It is OK</p>
     <% } else { %>
     <p>It is not OK</p>
     <% } %>

So I check for the comment with /*TEMPLATE and inject HTML and I also check for <% ending with %> and everything between those, I inject as JavaScript.
Now, the problem is that the javascript inspecion complains about the javascript pieces because they are not together so the if(test === true) { gets an error because the { is not closed with }.

I have tried to find a way to remove these inspections, but no matter what I do, I cannot seem to get hold of them.

Any ideas?


Please sign in to leave a comment.