To be able to search for headline-closing equal sign even when
there are comments between the last = and the linebreak, there are
some position values appended to the recent domParts. This works
well with the first comment, but as soon as a second one comes,
the commentEnd value is set to $wsEnd instead of $endPos.
Patch from Bergi
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 {
+ $part->commentEnd = $endPos;
+ if ( ! (isset( $part->commentEnd ) && $part->commentEnd == $wsStart - 1 )) {
$part->visualEnd = $wsStart;
- $part->commentEnd = $endPos;
}
+ // Else comments abutting, no change in visual end
}
$i = $endPos + 1;
$inner = substr( $text, $startPos, $endPos - $startPos + 1 );