From d8119bd420c619037680dee5f49849a423cf0640 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Sat, 15 Nov 2008 01:19:46 +0000 Subject: [PATCH] Revert r41710, r41978, r42012, r42048 (integration of Poem extension to core plus misc. fixes). Per Wikitech-l, this isn't properly attributed to the original authors of the extension. Furthermore, "Poem" is entirely too narrow a name for the functionality this tag provides. If this is to be integrated, a better name should be chosen. --- CREDITS | 1 - RELEASE-NOTES | 1 - includes/parser/Parser.php | 44 +------------- maintenance/parserTests.txt | 111 ------------------------------------ 4 files changed, 1 insertion(+), 156 deletions(-) diff --git a/CREDITS b/CREDITS index 6c0a6763e1..e4c545d5f0 100644 --- a/CREDITS +++ b/CREDITS @@ -56,7 +56,6 @@ following names for their contribution to the product. * Michael De La Rue * Mike Horvath * Mormegil -* Nathaniel Herman * Nathan Larson * Nikolaos S. Karastathis * Paul Copperman diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 50df753e56..5ed09d1409 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -70,7 +70,6 @@ The following extensions are migrated into MediaWiki 1.14: * Special:LinkSearch to search for external links (was extension LinkSearch) * RenderHash * NoMoveUserPages -* Poem (patch by Nathaniel Herman) * UniversalEditButton === New features in 1.14 === diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 7fc3a88c6b..fe016a8412 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -128,7 +128,7 @@ class Parser $this->mTransparentTagHooks = array(); $this->mFunctionHooks = array(); $this->mFunctionSynonyms = array( 0 => array(), 1 => array() ); - $this->mDefaultStripList = $this->mStripList = array( 'nowiki', 'gallery', 'poem' ); + $this->mDefaultStripList = $this->mStripList = array( 'nowiki', 'gallery' ); $this->mUrlProtocols = wfUrlProtocols(); $this->mExtLinkBracketedRegex = '/\[(\b(' . wfUrlProtocols() . ')'. '[^][<>"\\x00-\\x20\\x7F]+) *([^\]\\x0a\\x0d]*?)\]/S'; @@ -3317,9 +3317,6 @@ class Parser case 'gallery': $output = $this->renderImageGallery( $content, $attributes ); break; - case 'poem': - $output = $this->renderPoem( $content, $attributes ); - break; default: if( isset( $this->mTagHooks[$name] ) ) { # Workaround for PHP bug 35229 and similar @@ -4190,45 +4187,6 @@ class Parser return $ig->toHTML(); } - /** Renders any text in between tags - * based on http://www.mediawiki.org/wiki/Extension:Poem - */ - - function renderPoem( $in, $param = array() ) { - - /* using newlines in the text will cause the parser to add

tags, - * which may not be desired in some cases - */ - $nl = array_key_exists( 'compact', $param ) ? '' : "\n"; - - $replacer = new DoubleReplacer( ' ', ' ' ); - $text = $this->recursiveTagParse( $in ); - $text = $this->mStripState->unstripNoWiki( $text ); - // Only strip the very first and very last \n (which trim cannot do) - if( substr( $text, 0, 1 ) == "\n" ) - $text = substr( $text, 1 ); - if( substr( $text, -1 ) == "\n" ) - $text = substr( $text, 0, -1 ); - - $text = str_replace( "\n", "
\n", $text ); - $text = preg_replace_callback( - "/^( +)/m", - $replacer->cb(), - $text ); - - // Pass HTML attributes through to the output. - $attribs = Sanitizer::validateTagAttributes( $param, 'div' ); - - // Wrap output in a

with "poem" class. - if( array_key_exists( 'class', $attribs ) ) { - $attribs['class'] = 'poem ' . $attribs['class']; - } else { - $attribs['class'] = 'poem'; - } - - return Xml::openElement( 'div', $attribs ) . $nl . trim( $text ) . $nl . Xml::closeElement( 'div' ); - } - function getImageParams( $handler ) { if ( $handler ) { $handlerClass = get_class( $handler ); diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 34666b9667..06242c5b9a 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -7166,117 +7166,6 @@ language=fa

!! end -!!test - -!!input - -this -is -a -test - -!!result -
-

this
-is
-a
-test -

-
- -!!end - -!!test - with recursive parsing -!!input - -this ''is'' a '''test''' - -!! result -
-

this is a test -

-
- -!!end - - -!!test - with leading whitespace -!!input - - - test - - -!!result -
-


-   test
-

-
- -!!end - -!!test -Horizontal rule -!!input - -some ------ -text - -!!result -
-

some
-

-

-

text -

-
- -!!end - -!!test - nested -!!input - -this -is -a -test - -!!result -
-

this
-is
-a
-test -

-
- -!!end - -!!test - nested with formatting -!!input - -this -'''is''' -a -test - -!!result -
-

this
-'''is'''
-a
-test -

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