BUG#487 make regex not-so-greedy. If anchored to end-of-line, several lines are eaten if
authorJens Frank <jeluf@users.mediawiki.org>
Wed, 15 Sep 2004 05:53:21 +0000 (05:53 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Wed, 15 Sep 2004 05:53:21 +0000 (05:53 +0000)
there is text following the comment

includes/Parser.php

index 870ed18..d2af6df 100644 (file)
@@ -1784,7 +1784,7 @@ class Parser
                $htmlattrs = $this->getHTMLattrs () ;
 
                # Remove HTML comments
-               $text = preg_replace( '/(\\n *<!--.*--> *(?=\\n)|<!--.*-->)/sU', '$2', $text );
+               $text = preg_replace( '/(\\n *<!--.*--> *|<!--.*?-->)/sU', '', $text );
 
                $bits = explode( '<', $text );
                $text = array_shift( $bits );