r55635 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55634‎ | r55635 | r55636 >
Date:17:16, 27 August 2009
Author:werdna
Status:ok
Tags:
Comment:
Revert r52983 for now, could cause unexpected syntax interactions, we want to investigate this before deploying it
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)
  • /trunk/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -1882,7 +1882,7 @@
18831883 elseif ( ';' === $char ) {
18841884 $result .= '<dl><dt>';
18851885 $this->mDTopen = true;
1886 - } elseif ( '>' === $char ) { $result .= "<blockquote><p>"; }
 1886+ }
18871887 else { $result = '<!-- ERR 1 -->'; }
18881888
18891889 return $result;
@@ -1890,7 +1890,6 @@
18911891
18921892 /* private */ function nextItem( $char ) {
18931893 if ( '*' === $char || '#' === $char ) { return '</li><li>'; }
1894 - elseif ( '>' === $char ) { return "</p><p>"; }
18951894 elseif ( ':' === $char || ';' === $char ) {
18961895 $close = '</dd>';
18971896 if ( $this->mDTopen ) { $close = '</dt>'; }
@@ -1908,7 +1907,6 @@
19091908 /* private */ function closeList( $char ) {
19101909 if ( '*' === $char ) { $text = '</li></ul>'; }
19111910 elseif ( '#' === $char ) { $text = '</li></ol>'; }
1912 - elseif ( '>' === $char ) { $text = "</p></blockquote>"; }
19131911 elseif ( ':' === $char ) {
19141912 if ( $this->mDTopen ) {
19151913 $this->mDTopen = false;
@@ -1954,23 +1952,14 @@
19551953 // # = ol
19561954 // ; = dt
19571955 // : = dd
1958 - // > = blockquote
19591956
19601957 $lastPrefixLength = strlen( $lastPrefix );
19611958 $preCloseMatch = preg_match('/<\\/pre/i', $oLine );
19621959 $preOpenMatch = preg_match('/<pre/i', $oLine );
1963 -
1964 - // Need to decode &gt; --> > for blockquote syntax. Re-encode later.
1965 - // To avoid collision with real >s, we temporarily convert them to &gt;
1966 - // This is a weird choice of armouring, but it's totally resistant to any
1967 - // collision.
1968 - $orig = $oLine;
1969 - $oLine = strtr( $oLine, array( '&gt;' => '>', '>' => '&gt;' ) );
1970 -
19711960 // If not in a <pre> element, scan for and figure out what prefixes are there.
19721961 if ( !$this->mInPre ) {
19731962 # Multiple prefixes may abut each other for nested lists.
1974 - $prefixLength = strspn( $oLine, '*#:;>' );
 1963+ $prefixLength = strspn( $oLine, '*#:;' );
19751964 $prefix = substr( $oLine, 0, $prefixLength );
19761965
19771966 # eh?
@@ -1986,9 +1975,6 @@
19871976 $prefix = $prefix2 = '';
19881977 $t = $oLine;
19891978 }
1990 -
1991 - // Re-encode >s now
1992 - $t = strtr( $t, array( '&gt;' => '>', '>' => '&gt;' ) );
19931979
19941980 # List generation
19951981 if( $prefixLength && $lastPrefix === $prefix2 ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -136,7 +136,6 @@
137137 * Added a feature to allow per-article process pool size control for the parsing
138138 task, to limit resource usage when the cache for a heavily-viewed article is
139139 invalidated. Requires an external daemon.
140 -* Leading > is now syntax for <blockquote>.
141140 * (bug 19576) Moved the id attribues from the anchors accompanying section
142141 headers to the <span class="mw-headline"> elements within the section headers,
143142 removing the redundant anchor elements.
Index: trunk/phase3/maintenance/parserTests.txt
@@ -6577,9 +6577,9 @@
65786578 !! test
65796579 Always escape literal '>' in output, not just after '<'
65806580 !! input
6581 -test ><>
 6581+><>
65826582 !! result
6583 -<p>test &gt;&lt;&gt;
 6583+<p>&gt;&lt;&gt;
65846584 </p>
65856585 !! end
65866586
@@ -7399,24 +7399,6 @@
74007400 </p>
74017401 !! end
74027402
7403 -!! test
7404 -Leading > blockquote syntax
7405 -!! input
7406 -> Hi
7407 -> This
7408 -> Is
7409 -> A
7410 -> Quote
7411 -!! result
7412 -<blockquote><p> Hi
7413 -</p><p> This
7414 -</p><p> Is
7415 -</p><p> A
7416 -</p><p> Quote
7417 -</p></blockquote>
7418 -
7419 -!! end
7420 -
74217403 #
74227404 #
74237405 #

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r52983* Allow leading-> as syntax for quoting.werdna15:17, 9 July 2009

Status & tagging log