From 33f5a8983beac7149a167edd26040004b602ab8c Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Thu, 27 Aug 2009 17:16:15 +0000 Subject: [PATCH] Revert r52983 for now, could cause unexpected syntax interactions, we want to investigate this before deploying it --- RELEASE-NOTES | 1 - includes/parser/Parser.php | 18 ++---------------- maintenance/parserTests.txt | 22 ++-------------------- 3 files changed, 4 insertions(+), 37 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e7637a71f2..e8caad0627 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -136,7 +136,6 @@ this. Was used when mwEmbed was going to be an extension. * Added a feature to allow per-article process pool size control for the parsing task, to limit resource usage when the cache for a heavily-viewed article is invalidated. Requires an external daemon. -* Leading > is now syntax for
. * (bug 19576) Moved the id attribues from the anchors accompanying section headers to the elements within the section headers, removing the redundant anchor elements. diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 78fd7a0b07..8f66da8285 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -1882,7 +1882,7 @@ class Parser elseif ( ';' === $char ) { $result .= '
'; $this->mDTopen = true; - } elseif ( '>' === $char ) { $result .= "

"; } + } else { $result = ''; } return $result; @@ -1890,7 +1890,6 @@ class Parser /* private */ function nextItem( $char ) { if ( '*' === $char || '#' === $char ) { return '

  • '; } - elseif ( '>' === $char ) { return "

    "; } elseif ( ':' === $char || ';' === $char ) { $close = ''; if ( $this->mDTopen ) { $close = '

  • '; } @@ -1908,7 +1907,6 @@ class Parser /* private */ function closeList( $char ) { if ( '*' === $char ) { $text = ''; } elseif ( '#' === $char ) { $text = ''; } - elseif ( '>' === $char ) { $text = "

    "; } elseif ( ':' === $char ) { if ( $this->mDTopen ) { $this->mDTopen = false; @@ -1954,23 +1952,14 @@ class Parser // # = ol // ; = dt // : = dd - // > = blockquote $lastPrefixLength = strlen( $lastPrefix ); $preCloseMatch = preg_match('/<\\/pre/i', $oLine ); $preOpenMatch = preg_match('/
     > for blockquote syntax. Re-encode later.
    -			// To avoid collision with real >s, we temporarily convert them to >
    -			// This is a weird choice of armouring, but it's totally resistant to any
    -			//  collision.
    -			$orig = $oLine;
    -			$oLine = strtr( $oLine, array( '>' => '>', '>' => '>' ) );
    -			
     			// If not in a 
     element, scan for and figure out what prefixes are there.
     			if ( !$this->mInPre ) {
     				# Multiple prefixes may abut each other for nested lists.
    -				$prefixLength = strspn( $oLine, '*#:;>' );
    +				$prefixLength = strspn( $oLine, '*#:;' );
     				$prefix = substr( $oLine, 0, $prefixLength );
     
     				# eh?
    @@ -1986,9 +1975,6 @@ class Parser
     				$prefix = $prefix2 = '';
     				$t = $oLine;
     			}
    -			
    -			// Re-encode >s now
    -			$t = strtr( $t, array( '>' => '>', '>' => '>' ) );
     
     			# List generation
     			if( $prefixLength && $lastPrefix === $prefix2 ) {
    diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt
    index 9faf4e5976..f020094141 100644
    --- a/maintenance/parserTests.txt
    +++ b/maintenance/parserTests.txt
    @@ -6577,9 +6577,9 @@ RAW magic word
     !! test
     Always escape literal '>' in output, not just after '<'
     !! input
    -test ><>
    +><>
     !! result
    -

    test ><> +

    ><>

    !! end @@ -7399,24 +7399,6 @@ wgUseDynamicDates=true

    !! end -!! test -Leading > blockquote syntax -!! input -> Hi -> This -> Is -> A -> Quote -!! result -

    Hi -

    This -

    Is -

    A -

    Quote -

    - -!! end - # # # -- 2.20.1