Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function wrapAttrValue (attrValue: string) {
if (attrValue[0] === doubleQuote && attrValue.slice(-1) === doubleQuote) {
return attrValue;
}
return doubleQuote + Serializer.escapeString(attrValue, true) + doubleQuote;
}
serializer._serializeTextNode = function (node: AST.HtmlParser2.TextNode) {
const content: string = this.treeAdapter.getTextNodeContent(node);
const parent: AST.HtmlParser2.TextNode = this.treeAdapter.getParentNode(node);
let parentTn: string = void 0;
if (parent && this.treeAdapter.isElementNode(parent)) {
parentTn = this.treeAdapter.getTagName(parent);
}
if (parentTn === $.STYLE || parentTn === $.SCRIPT || parentTn === $.XMP || parentTn === $.IFRAME ||
parentTn === $.NOEMBED || parentTn === $.NOFRAMES || parentTn === $.PLAINTEXT || parentTn === $.NOSCRIPT) {
this.html += `${ reactInterpolation.startSymbol }\`${ content }\`${ reactInterpolation.endSymbol }`;
} else {
const escapedContent: string = Serializer.escapeString(content, false);
this.html += escapedContent && interpolate(ngParser, escapedContent, transformOptions) || '';
}
};