simple-html-tokenizer
Advanced tools
Comparing version 0.5.3 to 0.5.4
@@ -346,2 +346,6 @@ /** | ||
} | ||
else if (char === '/') { | ||
this.consume(); | ||
this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */); | ||
} | ||
else if (char === '&') { | ||
@@ -348,0 +352,0 @@ this.consume(); |
@@ -352,2 +352,6 @@ (function (global, factory) { | ||
} | ||
else if (char === '/') { | ||
this.consume(); | ||
this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */); | ||
} | ||
else if (char === '&') { | ||
@@ -354,0 +358,0 @@ this.consume(); |
@@ -100,2 +100,8 @@ (function (global, factory) { | ||
}); | ||
QUnit.test('A self-closing tag with an attribute with unquoted value without space before closing (regression)', function (assert) { | ||
var tokens = simpleHtmlTokenizer.tokenize('<input data-foo=bar/>'); | ||
assert.deepEqual(tokens, [ | ||
startTag('input', [['data-foo', 'bar', false]], true) | ||
]); | ||
}); | ||
QUnit.test('A tag with a / in the middle', function (assert) { | ||
@@ -102,0 +108,0 @@ var tokens = simpleHtmlTokenizer.tokenize('<img / src="foo.png">'); |
{ | ||
"name": "simple-html-tokenizer", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Simple HTML Tokenizer is a lightweight JavaScript library that can be used to tokenize the kind of HTML normally found in templates.", |
@@ -403,2 +403,5 @@ import { preprocessInput, isAlpha, isSpace } from './utils'; | ||
this.transitionTo(TokenizerState.beforeAttributeName); | ||
} else if (char === '/') { | ||
this.consume(); | ||
this.transitionTo(TokenizerState.selfClosingStartTag); | ||
} else if (char === '&') { | ||
@@ -405,0 +408,0 @@ this.consume(); |
@@ -137,2 +137,12 @@ import { | ||
QUnit.test( | ||
'A self-closing tag with an attribute with unquoted value without space before closing (regression)', | ||
function(assert) { | ||
let tokens = tokenize('<input data-foo=bar/>'); | ||
assert.deepEqual(tokens, [ | ||
startTag('input', [['data-foo', 'bar', false]], true) | ||
]); | ||
} | ||
); | ||
QUnit.test('A tag with a / in the middle', function(assert) { | ||
@@ -139,0 +149,0 @@ let tokens = tokenize('<img / src="foo.png">'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
949700
10386