Updated patch from Bergi re: r86676 with tested code to fix bug #28642
authorMark A. Hershberger <mah@users.mediawiki.org>
Fri, 22 Apr 2011 14:25:17 +0000 (14:25 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Fri, 22 Apr 2011 14:25:17 +0000 (14:25 +0000)
includes/parser/Preprocessor_DOM.php
includes/parser/Preprocessor_Hash.php

index 907cbd0..7ecbe19 100644 (file)
@@ -343,11 +343,11 @@ class Preprocessor_DOM implements Preprocessor {
 
                                                if ( $stack->top ) {
                                                        $part = $stack->top->getCurrentPart();
-                                                       $part->commentEnd = $endPos;
                                                        if ( ! (isset( $part->commentEnd ) && $part->commentEnd == $wsStart - 1 )) {
                                                                $part->visualEnd = $wsStart;
                                                        }
                                                        // Else comments abutting, no change in visual end
+                                                       $part->commentEnd = $endPos;
                                                }
                                                $i = $endPos + 1;
                                                $inner = substr( $text, $startPos, $endPos - $startPos + 1 );
index fbbc218..1cf136b 100644 (file)
@@ -304,13 +304,11 @@ class Preprocessor_Hash implements Preprocessor {
 
                                                if ( $stack->top ) {
                                                        $part = $stack->top->getCurrentPart();
-                                                       if ( isset( $part->commentEnd ) && $part->commentEnd == $wsStart - 1 ) {
-                                                               // Comments abutting, no change in visual end
-                                                               $part->commentEnd = $wsEnd;
-                                                       } else {
+                                                       if ( ! (isset( $part->commentEnd ) && $part->commentEnd == $wsStart - 1 )) {
                                                                $part->visualEnd = $wsStart;
-                                                               $part->commentEnd = $endPos;
                                                        }
+                                                       // Else comments abutting, no change in visual end
+                                                       $part->commentEnd = $endPos;
                                                }
                                                $i = $endPos + 1;
                                                $inner = substr( $text, $startPos, $endPos - $startPos + 1 );