diff --git a/mithril.js b/mithril.js index 380aefa8..e4a8dc67 100644 --- a/mithril.js +++ b/mithril.js @@ -97,7 +97,7 @@ } else if (match[3][0] === "[") { var attrValue = match[6] if (attrValue) attrValue = attrValue.replace(/\\(["'])/g, "$1") - cell.attrs[match[4]] = attrValue || "" + cell.attrs[match[4]] = attrValue || true } } diff --git a/test/mithril.js b/test/mithril.js index b0ddeb2d..88111f51 100644 --- a/test/mithril.js +++ b/test/mithril.js @@ -38,7 +38,7 @@ describe("m()", function () { }) it("sets attr without a value as an empty string", function () { - expect(m("[empty]")).to.have.deep.property("attrs.empty", "") + expect(m("[empty]")).to.have.deep.property("attrs.empty", true) }) it("sets correct single quoted attr", function () { @@ -48,9 +48,6 @@ describe("m()", function () { it("sets correct double quoted attr", function () { expect(m("[title=\"bar\"]")).to.have.deep.property("attrs.title", "bar") }) - it("sets pattern attr", function () { - expect(m("[pattern=\"[a-zA-Z0-9]{56}\"]")).to.have.deep.property("attrs.pattern", "[a-zA-Z0-9]{56}") - }) it("sets correct children with 1 string arg", function () { expect(m("div", "test"))