break;
case TEXT_NODE:
self.result += text_buffer;
- text_buffer = token.node.nodeValue.replace('&', '&').replace('<', '<');
+ text_buffer = token.node.nodeValue.replace(/&/g, '&').replace(/</g, '<');
break;
case COMMENT_NODE:
self.result += text_buffer;