diff --git a/mithril.js b/mithril.js index 9c2806ae..48b55bea 100644 --- a/mithril.js +++ b/mithril.js @@ -28,7 +28,7 @@ function compileSelector(selector) { var attrValue = match[6] if (attrValue) attrValue = attrValue.replace(/\\(["'])/g, "$1").replace(/\\\\/g, "\\") if (match[4] === "class") classes.push(attrValue) - else attrs[match[4]] = attrValue || true + else attrs[match[4]] = attrValue === "" ? attrValue : attrValue || true } } if (classes.length > 0) attrs.className = classes.join(" ") diff --git a/mithril.min.js b/mithril.min.js index 1513acc3..90285386 100644 --- a/mithril.min.js +++ b/mithril.min.js @@ -1,5 +1,5 @@ (function(){function z(b,d,e,f,h,m){return{tag:b,key:d,attrs:e,children:f,text:h,dom:m,domSize:void 0,state:void 0,_state:void 0,events:void 0,instance:void 0,skip:!1}}function B(b){var d,e=arguments[1],f=2;if(null==b||"string"!==typeof b&&"function"!==typeof b&&"function"!==typeof b.view)throw Error("The selector must be either a string or a component.");if("string"===typeof b&&!(d=M[b])){var h="div";for(var m=[],k={};d=P.exec(b);){var r=d[1],n=d[2];""===r&&""!==n?h=n:"#"===r?k.id=n:"."===r?m.push(n): -"["===d[3][0]&&((r=d[6])&&(r=r.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===d[4]?m.push(r):k[d[4]]=r||!0)}0