Comparing version 3.0.2 to 3.0.3
@@ -93,2 +93,3 @@ var REG = require('./reg'); | ||
var self = this; | ||
var isVoidEle = false | ||
@@ -124,4 +125,6 @@ if (this.str[0] === '>') { | ||
if (isVoid(dom.name) || attrStr.endsWith('/')) { | ||
dom.type = 'voidtag'; | ||
isVoidEle = true | ||
} else { | ||
@@ -133,2 +136,4 @@ dom.type = 'opentag'; | ||
} | ||
return isVoidEle | ||
}; | ||
@@ -142,16 +147,19 @@ | ||
var name = match[1]; | ||
this.attrs(name); | ||
match = this.match(REG.RAW_TAG_END(name)); | ||
// <textarea auto-height data-wpytyping-a="address2" /> | ||
if (!this.attrs(name)) { | ||
match = this.match(REG.RAW_TAG_END(name)); | ||
if (match) { | ||
match = match[0]; | ||
} else { | ||
match = this.str; | ||
this.str = ''; | ||
if (match) { | ||
match = match[0]; | ||
} else { | ||
match = this.str; | ||
this.str = ''; | ||
} | ||
this.dom.push({ | ||
type: 'text', | ||
value: match | ||
}) | ||
} | ||
this.dom.push({ | ||
type: 'text', | ||
value: match | ||
}); | ||
return true; | ||
@@ -158,0 +166,0 @@ } else if (match = this.match(REG.OPEN_TAG)) { |
{ | ||
"name": "htmldom", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "Simplified html handle in nodejs", | ||
@@ -5,0 +5,0 @@ "main": "htmldom.js", |
@@ -22,2 +22,10 @@ var assert = require('assert'); | ||
}); | ||
it('textarea closed', function() { | ||
var html = new HtmlDom('<textarea /><view></view>'); | ||
assert.equal(html.stringify({ | ||
selfClosed: true | ||
}), '<textarea/><view></view>'); | ||
}); | ||
}); |
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
87149
2383