Comparing version 2.0.3 to 2.0.4
var vdom = require('virtual-dom') | ||
var hyperx = require('../') | ||
var hyperx = require('hyperx') | ||
var hx = hyperx(vdom.h) | ||
@@ -4,0 +4,0 @@ |
@@ -204,3 +204,3 @@ var attrToProp = require('hyperscript-attribute-to-property') | ||
} else if (state === ATTR_VALUE && /\s/.test(c)) { | ||
res.push([ATTR_BREAK],[ATTR_VALUE,reg]) | ||
res.push([ATTR_VALUE,reg],[ATTR_BREAK]) | ||
reg = '' | ||
@@ -207,0 +207,0 @@ state = ATTR |
{ | ||
"name": "hyperx", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "tagged template string virtual dom builder", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -29,1 +29,37 @@ var test = require('tape') | ||
}) | ||
test('unquoted attribute', function (t) { | ||
var tree = hx`<div class=test></div>` | ||
t.equal(vdom.create(tree).toString(), '<div class="test"></div>') | ||
t.end() | ||
}) | ||
test('unquoted attribute preceded by boolean attribute', function (t) { | ||
var tree = hx`<div hidden dir=ltr></div>` | ||
t.equal(vdom.create(tree).toString(), '<div hidden="hidden" dir="ltr"></div>') | ||
t.end() | ||
}) | ||
test('unquoted attribute succeeded by boolean attribute', function (t) { | ||
var tree = hx`<div dir=ltr hidden></div>` | ||
t.equal(vdom.create(tree).toString(), '<div dir="ltr" hidden="hidden"></div>') | ||
t.end() | ||
}) | ||
test('unquoted attribute preceded by normal attribute', function (t) { | ||
var tree = hx`<div id="test" class=test></div>` | ||
t.equal(vdom.create(tree).toString(), '<div id="test" class="test"></div>') | ||
t.end() | ||
}) | ||
test('unquoted attribute succeeded by normal attribute', function (t) { | ||
var tree = hx`<div id=test class="test"></div>` | ||
t.equal(vdom.create(tree).toString(), '<div id="test" class="test"></div>') | ||
t.end() | ||
}) | ||
test('consecutive unquoted attributes', function (t) { | ||
var tree = hx`<div id=test class=test></div>` | ||
t.equal(vdom.create(tree).toString(), '<div id="test" class="test"></div>') | ||
t.end() | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31442
792