Index: includes/parser/Parser.php =================================================================== --- includes/parser/Parser.php (revision 60487) +++ includes/parser/Parser.php (working copy) @@ -2052,15 +2052,33 @@ // If we have no prefixes, go to paragraph mode. if( 0 == $prefixLength ) { wfProfileIn( __METHOD__."-paragraph" ); - # No prefix (not in list)--go to paragraph mode // XXX: use a stack for nestable elements like span, table and div - $openmatch = preg_match('/(?:
mUniqPrefix.'-pre|<\\/li|<\\/ul|<\\/ol|<\\/?center)/iS',
+ $t, $closeblock, PREG_OFFSET_CAPTURE);
if ( $openmatch or $closematch ) {
$paragraphStack = false;
- # TODO bug 5718: paragraph closed
+ #TODO bug 5718: paragraph closed
+ $tagstart = -1;
+ if ($openmatch) {
+ $tagstart = $openblock[0][1];
+ } else {
+ $tagstart = $closeblock[0][1];
+ }
+ if (!preg_match('/<\\/?div/', $t)) {
+ // FIXME: Handle div as a special case to stay
+ // consistent with old behavior after fixing
+ // bug 5718, but div processing needs to be fixed.
+ $output .= substr($t, 0, $tagstart);
+ $t = substr($t, $tagstart);
+ }
$output .= $this->closeParagraph();
if ( $preOpenMatch and !$preCloseMatch ) {
$this->mInPre = true;
@@ -2089,6 +2107,9 @@
} else {
if ($this->mLastSection !== 'p' ) {
$output .= $this->closeParagraph();
+ // FIXME: closeParagraph will clear
+ // mLastSection. Don't need to do that in
+ // both places.
$this->mLastSection = '';
$paragraphStack = ' '; } else { |