$term = $t2 = '';
if ( $this->findColonNoLinks( $t, $term, $t2 ) !== false ) {
$t = $t2;
- $output .= $term . $this->nextItem( ':' );
+ // Trim whitespace in list items
+ $output .= trim( $term ) . $this->nextItem( ':' );
}
}
} elseif ( $prefixLength || $lastPrefixLength ) {
# @todo FIXME: This is dupe of code above
if ( $this->findColonNoLinks( $t, $term, $t2 ) !== false ) {
$t = $t2;
- $output .= $term . $this->nextItem( ':' );
+ // Trim whitespace in list items
+ $output .= trim( $term ) . $this->nextItem( ':' );
}
}
++$commonPrefixLength;
if ( $openMatch || $closeMatch ) {
$pendingPTag = false;
- # @todo T7718: paragraph closed
- $output .= $this->closeParagraph();
+ // Only close the paragraph if we're not inside a <pre> tag, or if
+ // that <pre> tag has just been opened
+ if ( !$this->inPre || $preOpenMatch ) {
+ // @todo T7718: paragraph closed
+ $output .= $this->closeParagraph();
+ }
if ( $preOpenMatch && !$preCloseMatch ) {
$this->inPre = true;
}
$this->inPre = false;
}
if ( $pendingPTag === false ) {
- $output .= $t;
if ( $prefixLength === 0 ) {
+ $output .= $t;
$output .= "\n";
+ } else {
+ // Trim whitespace in list items
+ $output .= trim( $t );
}
}
}