}
} else {
- html = html.replace(new RegExp("(.*)<\/" + stack.last() + "[^>]*>"), function(all, text){
- text = text.replace(/<!--(.*?)-->/g, "$1")
- .replace(/<!\[CDATA\[(.*?)]]>/g, "$1");
+ html = html.replace(new RegExp("([\\s\\S]*?)<\/" + stack.last() + "[^>]*>"), function(all, text){
+ text = text
+ .replace(/<!--([\s\S]*?)-->/g, "$1")
+ .replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g, "$1");
if ( handler.chars )
handler.chars( text );