Choo: Falsy attributes are rendered by pelo

Created on 2 Aug 2017  路  4Comments  路  Source: choojs/choo

Since not actually parsing the html is what makes pelo fast compared to bel, I'm not quite sure how this could be addressed but nonetheless it's an issue that output differs. Also these kinds of patterns, using booleans to determine i.e. input disabled state is quite common, at least in my case.

Expected behavior

Elements with interpolated falsy (null/false) values be excluded from output.

html`<input disabled=${ false } />`

Actual behavior

<!-- pelo output -->
<input disabled="" />

<!-- bel output -->
<input />

Pelo renders attributes with falsy values as attribute="" whereas bel completely excludes them.

Steps to reproduce behavior

See requirebin: http://requirebin.com/?gist=1dc8acd84ec5bb811458131431bffc4b

Most helpful comment

Thanks! Upstreaming this to https://github.com/shuhei/pelo/issues/8

All 4 comments

Thanks! Upstreaming this to https://github.com/shuhei/pelo/issues/8

A fix is out: https://github.com/shuhei/pelo/issues/8#event-1192259430 in [email protected]. Anyone feel up to bumping bel?

Fixed in https://github.com/shama/bel/releases/tag/v5.0.3 and no updates required for Choo to get that. 馃檶

Please let me know if that doesn't fix the issue and we can reopen.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NetOperatorWibby picture NetOperatorWibby  路  5Comments

ungoldman picture ungoldman  路  3Comments

wenkesj picture wenkesj  路  3Comments

ramstein74 picture ramstein74  路  6Comments

awesomektvn picture awesomektvn  路  5Comments