@oozcitak/dom
Advanced tools
Comparing version 1.15.9 to 1.15.10
@@ -14,2 +14,14 @@ import { Document } from "../dom/interfaces"; | ||
parse(source: string): Document; | ||
/** | ||
* Decodes serialized text. | ||
* | ||
* @param text - text value to serialize | ||
*/ | ||
private _decodeText; | ||
/** | ||
* Decodes serialized attribute value. | ||
* | ||
* @param text - attribute value to serialize | ||
*/ | ||
private _decodeAttributeValue; | ||
} |
@@ -35,3 +35,2 @@ "use strict"; | ||
var LocalNameSet_1 = require("../serializer/LocalNameSet"); | ||
var he_1 = require("he"); | ||
/** | ||
@@ -106,3 +105,3 @@ * Represents a parser for XML content. | ||
} | ||
context.appendChild(doc.createTextNode(he_1.decode(text.data))); | ||
context.appendChild(doc.createTextNode(this._decodeText(text.data))); | ||
break; | ||
@@ -189,5 +188,5 @@ case interfaces_1.TokenType.Element: | ||
if (attNamespace !== null) | ||
elementNode.setAttributeNS(attNamespace, attName, attValue); | ||
elementNode.setAttributeNS(attNamespace, attName, this._decodeAttributeValue(attValue)); | ||
else | ||
elementNode.setAttribute(attName, attValue); | ||
elementNode.setAttribute(attName, this._decodeAttributeValue(attValue)); | ||
} | ||
@@ -221,2 +220,22 @@ } | ||
}; | ||
/** | ||
* Decodes serialized text. | ||
* | ||
* @param text - text value to serialize | ||
*/ | ||
XMLParserImpl.prototype._decodeText = function (text) { | ||
return text == null ? text : text.replace(/</g, '<') | ||
.replace(/>/g, '>') | ||
.replace(/&/g, '&'); | ||
}; | ||
/** | ||
* Decodes serialized attribute value. | ||
* | ||
* @param text - attribute value to serialize | ||
*/ | ||
XMLParserImpl.prototype._decodeAttributeValue = function (text) { | ||
return text == null ? text : text.replace(/</g, '<') | ||
.replace(/>/g, '>') | ||
.replace(/&/g, '&'); | ||
}; | ||
return XMLParserImpl; | ||
@@ -223,0 +242,0 @@ }()); |
{ | ||
"name": "@oozcitak/dom", | ||
"version": "1.15.9", | ||
"version": "1.15.10", | ||
"keywords": [ | ||
@@ -30,4 +30,3 @@ "dom", | ||
"@oozcitak/url": "1.0.4", | ||
"@oozcitak/util": "8.3.8", | ||
"he": "1.2.0" | ||
"@oozcitak/util": "8.3.8" | ||
}, | ||
@@ -42,3 +41,2 @@ "devDependencies": { | ||
"@types/xmldom": "*", | ||
"@types/he": "*", | ||
"benchmark": "*", | ||
@@ -45,0 +43,0 @@ "chalk": "*", |
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
1236631
3
19
24524