"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "extensions/Poem/includes/Poem.php" between
mediawiki-1.31.1.tar.gz and mediawiki-1.32.0.tar.gz

About: MediaWiki is a wiki engine (the collaborative editing software that runs for e.g. Wikipedia, the free encyclopedia).

Poem.php  (mediawiki-1.31.1):Poem.php  (mediawiki-1.32.0)
skipping to change at line 38 skipping to change at line 38
// using newlines in the text will cause the parser to add <p> ta gs, // using newlines in the text will cause the parser to add <p> ta gs,
// which may not be desired in some cases // which may not be desired in some cases
$newline = isset( $param['compact'] ) ? '' : "\n"; $newline = isset( $param['compact'] ) ? '' : "\n";
$tag = $parser->insertStripItem( "<br />" ); $tag = $parser->insertStripItem( "<br />" );
// replace colons with indented spans // replace colons with indented spans
$text = preg_replace_callback( '/^(:+)(.+)$/m', [ self::class, 'i ndentVerse' ], $in ); $text = preg_replace_callback( '/^(:+)(.+)$/m', [ self::class, 'i ndentVerse' ], $in );
// replace newlines with <br /> tags unless they are at the begin ning or end // replace newlines with <br /> tags unless they are at the begin ning or end
// of the poem // of the poem, or would directly follow exactly 4 dashes. See Pa
rser::internalParse() for
// the exact syntax for horizontal rules.
$text = preg_replace( $text = preg_replace(
[ "/^\n/", "/\n$/D", "/\n/" ], [ '/^\n/', '/\n$/D', '/(?<!^----)\n/m' ],
[ "", "", "$tag\n" ], [ "", "", "$tag\n" ],
$text $text
); );
// replace spaces at the beginning of a line with non-breaking sp aces // replace spaces at the beginning of a line with non-breaking sp aces
$text = preg_replace_callback( '/^( +)/m', [ self::class, 'replac eSpaces' ], $text ); $text = preg_replace_callback( '/^( +)/m', [ self::class, 'replac eSpaces' ], $text );
$text = $parser->recursiveTagParse( $text, $frame ); $text = $parser->recursiveTagParse( $text, $frame );
// Because of limitations of the regular expression above, horizo
ntal rules with more than 4
// dashes still need special handling.
$text = str_replace( '<hr />' . $tag, '<hr />', $text );
$attribs = Sanitizer::validateTagAttributes( $param, 'div' ); $attribs = Sanitizer::validateTagAttributes( $param, 'div' );
// Wrap output in a <div> with "poem" class. // Wrap output in a <div> with "poem" class.
if ( isset( $attribs['class'] ) ) { if ( isset( $attribs['class'] ) ) {
$attribs['class'] = 'poem ' . $attribs['class']; $attribs['class'] = 'poem ' . $attribs['class'];
} else { } else {
$attribs['class'] = 'poem'; $attribs['class'] = 'poem';
} }
return Html::rawElement( 'div', $attribs, $newline . trim( $text ) . $newline ); return Html::rawElement( 'div', $attribs, $newline . trim( $text ) . $newline );
 End of changes. 3 change blocks. 
2 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)