File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ module.exports = function (h, opts) {
175
175
state = ATTR
176
176
} else if ( state === OPEN ) {
177
177
reg += c
178
- } else if ( state === ATTR && / [ \w - ] / . test ( c ) ) {
178
+ } else if ( state === ATTR && / [ ^ \s " ' = / ] / . test ( c ) ) {
179
179
state = ATTR_KEY
180
180
reg = c
181
181
} else if ( state === ATTR && / \s / . test ( c ) ) {
Original file line number Diff line number Diff line change @@ -62,3 +62,15 @@ test('consecutive unquoted attributes', function (t) {
62
62
t . equal ( vdom . create ( tree ) . toString ( ) , '<div id="test" class="test"></div>' )
63
63
t . end ( )
64
64
} )
65
+
66
+ test ( 'strange leading character attributes' , function ( t ) {
67
+ var tree = hx `<div @click='test' :href='/foo'></div>`
68
+ t . equal ( vdom . create ( tree ) . toString ( ) , '<div @click="test" :href="/foo"></div>' )
69
+ t . end ( )
70
+ } )
71
+
72
+ test ( 'strange inbetween character attributes' , function ( t ) {
73
+ var tree = hx `<div f@o='bar' b&z='qux'></div>`
74
+ t . equal ( vdom . create ( tree ) . toString ( ) , `<div f@o="bar" b&z="qux"></div>` )
75
+ t . end ( )
76
+ } )
You can’t perform that action at this time.
0 commit comments