简体   繁体   中英

Meteor Custom HTML tags not recognised

I have a <navbar> html tag I use to assign my CSS navbar styles to my page. It works when not in a Meteor development environment but Meteor does not seem to understand custom tags. I will probably end up switching over to a div container instead but I was curious if Meteor can read them.

<navbar>
    <img class="just-another-image" src="/img/vector-logos-for-the-win.svg"></img>
    <div class="more-navbar-stuff"></div>
</navbar>

And Meteor returned something like this error:

While Building the application:
client/index.html:123: Expected "navbar" end tag
.../vector-logos-for-the-win.svg"></img>         <div class="mor...
                                        ^

Does Meteor support these tags and I am just doing something wrong or do I have to use divs? I do close the navbar tag at the end of my navbar and this is obviously an example. My real navbar contains much more content and it is possible that an unbalanced tag is causing the error.

Don't close your img tag, it's a self enclosed tag, ie <img class="..." src="..."> — saimeunt

I went and use a find-replace </img> on the entire document and this seemed to fix the issue. It turns out it did have to do with unbalanced tags and custom tags are compatible.

I've used custom tags with Meteor before (experimentally, not in production) and had no issues. I changed them to normal tags later to be safe, but hadn't seen any problems at all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM