Problems parsing link-to with class names
kandebonfim opened this issue · comments
Seems like adding an underscore in class name causes some misunderstanding in emblem's link parser.
this:
link-to .navtest 'dashboard' | Click me
gives me:
<a id="ember699" href="/dashboard" class="navtest">Click me</a>
but:
link-to .nav__item 'dashboard' | Gerenciar Cardápio
generates:
<a id="ember699" href="#" class="nav">Gerenciar Cardápio</a>
It sucks when writing BEM markup... 😁
Interesting! I'm honestly surprised a helper / component is working with the dot notation. I've always operated under the assumption that the .
and #
helpers are for dom elements, and any Ember helpers / components should use classNames
or class
.
What is interesting is that underscores work just fine in both of those situations:
div.some__class
= link-to classNames='some__class'
However, since this functionality does exist we should definitely take a look at why on helpers / components the dot notation gets confused.
@thec0keman I had the idea of doing this way looking at the parser.
I though it was on purpose.