xml-toolkit 1.0.45 → 1.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/XMLNode.js +9 -9
- package/package.json +1 -1
package/lib/XMLNode.js
CHANGED
|
@@ -146,17 +146,17 @@ const XMLNode = class extends SAXEvent {
|
|
|
146
146
|
|
|
147
147
|
get text () {
|
|
148
148
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
if (this [TYPE] === SAXEvent.TYPES.CHARACTERS) {
|
|
149
|
+
const s = super.text; if (this [TYPE] !== SAXEvent.TYPES.CHARACTERS) return s
|
|
152
150
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
151
|
+
const entityResolver = this [ENTITY_RESOLVER]; return entityResolver ? entityResolver.fix (s) : s
|
|
152
|
+
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
get innerText () {
|
|
156
|
+
|
|
157
|
+
const {children} = this; if (!Array.isArray (children) || children.length === 0) return this.text
|
|
158
158
|
|
|
159
|
-
return s
|
|
159
|
+
let s = ''; for (const child of children) s += child.innerText; return s
|
|
160
160
|
|
|
161
161
|
}
|
|
162
162
|
|