Support for HTML Custom Tag Variables

 

Hi all,

we use Handlebars as template language and have also variables for some tags:

<{{headlineTag}} class="xyz">{{headline}}</{{headlineTag}}>

The IDE is confused and many things break, e.g. the indenting/reformatting and checking for closing tags in the whole file.

Adding those tags as "Custom HTML tags" in the Inspections dialog did not help. Does anyone know a solution to this problem?

Thank you!
Sebastian

1
8 comments

To me, no errors are reported for such syntax:

are your files treated as handlebars by IDE?

0

Hi Elena,

thanks for your feedback. Yes, the tag itself is working.

But as soon you have a more complex structure around, the mentioned problems appear (problems with indenting/reformatting and checking for closing tags)

Best regards,
Sebastian

0

I see. I'm not aware of any solutions:( As tags are matched by name, dynamically generated names may indeed break it

0

Well, the simplest solution would enable adding custom tags with special chars ("{{headlineTag}}").

This does actually work, but only for auto-completition. The other listed features do not work or even break.

0

but these are not valid HTML tags...

0

Well, actually I use the "Handlebar/Mustache" Plugin. Maybe it's possible to add such a support in the plugin?

I thought I can solve it with "Editor > Unknown HTML tags > Custom HTML Tags"...

 

0

Please sign in to leave a comment.