parseEndTag('', lastTag);
}
- if (!handler.html5) {
+ if (!handler.html5 && !inline(tagName)) {
while (lastTag && inline(lastTag)) {
parseEndTag('', lastTag);
}
assert.equal(minify(input), output);
});
+QUnit.test('HTML4: anchor with inline elements', function(assert) {
+ var input = '<a href="#"><span>Well, look at me! I\'m a span!</span></a>';
+ assert.equal(minify(input, { html5: false }), input);
+});
+
+QUnit.test('HTML5: anchor with inline elements', function(assert) {
+ var input = '<a href="#"><span>Well, look at me! I\'m a span!</span></a>';
+ assert.equal(minify(input, { html5: true }), input);
+});
+
QUnit.test('HTML4: anchor with block elements', function(assert) {
var input = '<a href="#"><div>Well, look at me! I\'m a div!</div></a>';
var output = '<a href="#"></a><div>Well, look at me! I\'m a div!</div>';