r104252 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104251‎ | r104252 | r104253 >
Date:21:15, 25 November 2011
Author:maxsem
Status:ok
Tags:
Comment:
Special:Hieroglyphs: fix copypasta errors in descriptions, properly break on newlines
Modified paths:
  • /trunk/extensions/wikihiero/SpecialHieroglyphs.php (modified) (history)
  • /trunk/extensions/wikihiero/modules/ext.wikihiero.Special.js (modified) (history)

Diff [purge]

Index: trunk/extensions/wikihiero/SpecialHieroglyphs.php
@@ -25,11 +25,11 @@
2626 private $syntaxHelp = array(
2727 array( 'code' => '-', 'message' => 'wikihiero-separator', 'example' => 'A1 - B1' ),
2828 array( 'code' => ':', 'message' => 'wikihiero-superposition', 'example' => 'p:t' ),
29 - array( 'code' => ':', 'message' => 'wikihiero-juxtaposition', 'example' => 'p*t' ),
 29+ array( 'code' => '*', 'message' => 'wikihiero-juxtaposition', 'example' => 'p*t' ),
3030 array( 'code' => '!', 'message' => 'wikihiero-eol', 'example' => 'A1-B1 ! C1-D1' ),
3131 array( 'code' => '\\', 'message' => 'wikihiero-mirror', 'example' => 'A1\-A1' ),
3232 array( 'code' => '..', 'message' => 'wikihiero-void', 'example' => 'A1 .. B1' ),
33 - array( 'code' => '..', 'message' => 'wikihiero-half-void', 'example' => 'A1 . B1' ),
 33+ array( 'code' => '.', 'message' => 'wikihiero-half-void', 'example' => 'A1 . B1' ),
3434 array( 'code' => '<!-- -->', 'message' => 'wikihiero-comment', 'example' => 'A<!-- B1 -->1' ),
3535 );
3636 private $helpColumns = array(
@@ -57,8 +57,8 @@
5858 $out->addHTML( '<table class="wikitable">'
5959 . '<tr><th>' . wfMsg( 'wikihiero-input' ) . '</th><th>'
6060 . wfMsg( 'wikihiero-result' ) . '</th></tr>'
61 - . '<tr><td><code>&lt;hiero&gt;' . htmlspecialchars( $text ) . '&lt;/hiero&gt;</code></td>'
62 - . "<td>{$hiero->render( $text )}</td></tr></table>"
 61+ . '<tr><td><code>&lt;hiero&gt;' . nl2br( htmlspecialchars( $text ) )
 62+ . "&lt;/hiero&gt;</code></td><td>{$hiero->render( $text )}</td></tr></table>"
6363 );
6464 }
6565
Index: trunk/extensions/wikihiero/modules/ext.wikihiero.Special.js
@@ -30,7 +30,7 @@
3131 var html = '<table class="wikitable">'
3232 + '<tr><th>' + mw.msg( 'wikihiero-input' ) + '</th><th>'
3333 + mw.msg( 'wikihiero-result' ) + '</th></tr>'
34 - + '<tr><td><code>&lt;hiero&gt;' + mw.html.escape( text ) + '&lt;/hiero&gt;</code></td>'
 34+ + '<tr><td><code>&lt;hiero&gt;' + mw.html.escape( text ).replace( '\n', '<br/>' ) + '&lt;/hiero&gt;</code></td>'
3535 + '<td>' + data.parse.text['*'] + '</td></tr></table>';
3636 $.removeSpinner( 'hiero' );
3737 $result.html( html );

Status & tagging log