drupal-pattern-lab / bem-twig-extension

Twig function that inserts static classes into Pattern Lab but adds them to attributes in Drupal
GNU General Public License v2.0
14 stars 7 forks source link

Modifier doesn't check if modifier is empty! #13

Open VishalKumarSahu opened 5 years ago

VishalKumarSahu commented 5 years ago

https://github.com/drupal-pattern-lab/bem-twig-extension/blob/c772316bb6121823dcae157abfd1c173441e121d/bem.function.php#L19

If we pass an array of modifer like bem(base_element, ['mod1', 'mod2', '']) returns base_element--mod1 base_element--mod2 base_element-- where last part is undesirable, since inside twig some variable may be empty. So there should be some check for if the value is there or it is empty.

jeff-cardwell commented 5 years ago

Whoops. I didn't see this issue before I created PR #15. It should fix this.