this.text = options.template; }; Text.prototype = { detach: detach, firstNode () { return this.node; }, render () { if ( !this.node ) { this.node = document.createTextNode( this.text ); } return this.node; }, toString ( escape ) { return escape ? escapeHtml( this.text ) : this.text; }, unrender ( shouldDestroy ) { if ( shouldDestroy ) { return this.detach(); } } }; export default Text;
it('should escape html', () => { escapeHtml('<strong>Escape me!</strong>').should.eq('<strong>Escape me!</strong>'); });