From 4c21af5d7166cf45409066d062b04586d8616c25 Mon Sep 17 00:00:00 2001 From: Juriy Zaytsev Date: Fri, 5 Feb 2010 23:51:19 -0500 Subject: [PATCH] Fix multi-line comment and CDATA matching. --- htmlparser.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htmlparser.js b/htmlparser.js index a58e9f0..7352119 100644 --- a/htmlparser.js +++ b/htmlparser.js @@ -111,9 +111,10 @@ } } 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") + .replace(//g, "$1"); if ( handler.chars ) handler.chars( text ); -- 2.34.1