r89167 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89166‎ | r89167 | r89168 >
Date:13:53, 30 May 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
fixed output that was getting messed up by the mw parser
Modified paths:
  • /trunk/extensions/Spark/Spark.class.php (modified) (history)
  • /trunk/extensions/Spark/Spark.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Spark/Spark.hooks.php
@@ -44,7 +44,7 @@
4545 }
4646
4747 $tag = new SparkTag( $args, $input );
48 - return $tag->render();
 48+ return $tag->render( $parser );
4949 }
5050
5151 }
\ No newline at end of file
Index: trunk/extensions/Spark/Spark.class.php
@@ -41,17 +41,21 @@
4242 *
4343 * @since 0.1
4444 *
 45+ * @param Parser $parser
 46+ *
4547 * @return string
4648 */
47 - public function render() {
 49+ public function render( Parser $parser ) {
4850 if ( array_key_exists( 'data-spark-query', $this->parameters ) ) {
4951 $query = htmlspecialchars( $this->parameters['data-spark-query'] );
5052 $query = str_replace( array( '&lt;', '&gt;' ), array( '<', '>' ), $query );
5153 unset( $this->parameters['data-spark-query'] );
5254
53 - return '<div class="spark" data-spark-query="' . $query . '" ' . Html::expandAttributes( $this->parameters ) . ' >' .
 55+ $html = '<div class="spark" data-spark-query="' . $query . '" ' . Html::expandAttributes( $this->parameters ) . ' >' .
5456 ( is_null( $this->contents ) ? '' : htmlspecialchars( $this->contents ) ) .
55 - '</div>';
 57+ '</div>';
 58+
 59+ return array( $parser->insertStripItem( $html, $parser->mStripState ), 'noparse' => true, 'isHTML' => true );
5660 }
5761 else {
5862 return Html::element( 'i', array(), wfMsg( 'spark-missing-query' ) );

Status & tagging log