Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
appendNode(node: hbs.ConcatContent, source: string): void {
switch (this.htmlParser.tokenizer.state) {
case TokenizerState.attributeValueSingleQuoted:
case TokenizerState.attributeValueDoubleQuoted: {
assert(
isAttrValue(node),
`the right hand side of an attribute must be a valid attribute value (text, mustache or concat)`
);
this.element.appendStatementToAttributeValue(node, source);
break;
}
case TokenizerState.beforeAttributeValue: {
assert(
isAttrValue(node),
`the right hand side of an attribute must be a valid attribute value (text, mustache or concat)`
);
this.element.finalizeAttributeWithStatement(node, source);
this.htmlParser.tokenizer.transitionTo(TokenizerState.afterAttributeValueQuoted);
break;
}
default:
this.parent.appendNode(node);
}
}