diff --git a/htmlparser.js b/htmlparser.js index 0b552f0..f0f547d 100644 --- a/htmlparser.js +++ b/htmlparser.js @@ -109,10 +109,8 @@ } } else { - html = html.replace(new RegExp("(.*?)<\/" + stack.last() + "[^>]*>"), function (all, text) { - text = text.replace(//g, "$1") - .replace(//g, "$1"); - + html = html.replace(new RegExp("([\\s\\S]*?)<\/" + stack.last() + "[^>]*>"), function (all, text) { + text = text.replace(/|/g, "$1$2"); if (handler.chars) handler.chars(text);