From: Juriy Zaytsev Date: Sat, 6 Feb 2010 04:51:19 +0000 (-0500) Subject: Fix multi-line comment and CDATA matching. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=4c21af5d7166cf45409066d062b04586d8616c25;p=html-minifier.git Fix multi-line comment and CDATA matching. --- 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 );