ignore Placeholder in templates e.g. HTML for inspections Follow
In our project we use a template engine for html files, able to fill defined placeholder. This can be used for simple values or bigger code segments
The engine also allows to use placeholder as an condition to render or not to render specific segments:
This also allows using this conditions in html attributes:
But the last kind of use can not be handled by the inspections.
So my question is, are they options like modify the inspection rule or define code segments (templates) which should not be consider by inspections. Something which allows me to negate a inspection rule in special circumstances without deactivating it.
Thanks for help.
Please sign in to leave a comment.
Basically, there is no specific option to modify the inspection rule.
All you can do is to tell IDE to suppress the inspection for the specific places in code. By the way, what exact inspection warning are you seeing?
thanks for your answer.
The inspection warnings are different.
- General | Syntax error () -> Tag start is not closed, a term expected, ':' expected
- HTML | Unknown HTML tag attribute
- XML | Unbound XML namespace prefix
Seems to be depend strongly an circumstance how we used it. In general it seems to break everything after the placeholder, so code inspections is not able to connect code before and code after.
Sadly we used this kind of coding very often and suppressing should be the last alternative.
I was hoping we could define placeholders so code circumstance could ignore them (e.g. as an regular expression)
Definitely no, this would've caused a performance nightmare.
Which template engine do you use?
its a selfmade engine.