Page MenuHomePhabricator

Parser.patch

Authored By
bzimport
Nov 21 2014, 9:35 PM
Size
1 KB
Referenced Files
None
Subscribers
None

Parser.patch

Index: includes/Parser.php
===================================================================
--- includes/Parser.php (revision 20561)
+++ includes/Parser.php (arbetskopia)
@@ -263,7 +263,7 @@
*
* @param string $text Text we want to parse
* @param Title &$title A title object
- * @param array $options
+ * @param ParserOptions $options
* @param boolean $linestart
* @param boolean $clearState
* @param int $revid number to pass in {{REVISIONID}}
@@ -2066,8 +2066,18 @@
if ( !$linestart ) {
$output .= array_shift( $textLines );
}
- foreach ( $textLines as $oLine ) {
+ foreach ( $textLines as $key => $oLine ) {
+
$lastPrefixLength = strlen( $lastPrefix );
+ if(
+ trim($oLine) == '' && # we have an empty line
+ $lastPrefixLength > 0 && # last line was a list
+ array_key_exists( $key + 1, $textLines ) && # we have more lines
+ strspn( $textLines[ $key + 1 ], '*#:;' ) > 0 # next line is a list item
+ ) {
+ continue; #just jump to next line;
+ }
+
$preCloseMatch = preg_match('/<\\/pre/i', $oLine );
$preOpenMatch = preg_match('/<pre/i', $oLine );
if ( !$this->mInPre ) {

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3260
Default Alt Text
Parser.patch (1 KB)

Event Timeline