Add a specific tag in HTML
I'm using a template engine that can produce some tags like <:any_string:any_string:>
PhpStorm is waiting for a closing tag and produces warnings and wrong autocompletion.
Is there a way to register this kind of tags as self closing tags, like <br> and <img> ?
Or to simply ignore these ?
Please sign in to leave a comment.
Hi there,
Do I see it correctly and you have semicolon after < and before > ?
If so -- it's not really a HTML tag .. and that would be NO.
"No" also applies to any_string -- it has to be specific_string.
But "proper" unrecognised tags like (for example) <meow> can be added to list in "Settings/Preferences | Editor | Inspections | HTML | Unknown HTML tag"
... or directly via Quick Fix menu (Alt+Enter .. or via light bulb icon)
But even in such case -- it should have closing pair (<meow></meow>) or be empty tag (<meow />)
P.S.
I've tried and added :any_string:any_string: to the aforementioned inspection ... but
1) it will recognize only that specific sequence (which means -- only ":any_string:any_string:" exactly and no variations .. otherwise it will be another tag/entry in exclusion list)
2) IDE still warns about unclosed tag (see the line before P.S.)
----
So for your case -- custom templating engine syntax -- it will not help. And there is no options in IDE to simply ignore such unknown tags/syntax (this IDE does not work like that) -- it has to be known (e.g. some plugin for this or similar syntax)
Andriy, thank you for your answer.
And you see correctily, there are semi colons in these tags.
I had a little hope but i understand this is a very specific case.
I'll have a look at plugin development.
Some links for plugins: