* (bug 10422) Change <pre> on CSS/JS pages to <div> and allow wikitext
authorAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 1 Jul 2007 19:57:30 +0000 (19:57 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 1 Jul 2007 19:57:30 +0000 (19:57 +0000)
* Remove now-unused ShowRawCssJs hook, unless someone can think of a reason someone would want to use it when wikitext is allowed inside it

Patch to SyntaxHighlight_GeSHi to come in a moment.

RELEASE-NOTES
docs/hooks.txt
includes/Article.php

index 1185fbb..577b7a8 100644 (file)
@@ -104,17 +104,18 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 9250) Remove hardcoded minimum image name length of three characters
 * Fixed DISPLAYTITLE behaviour to reject titles which don't normalise to the
   same title as the current page, and enabled per default
-* Wrap site CSS and JavaScript in a <pre> tag, like user JS/CSS
-* (bug 10196) Add classes and dir="ltr" to the <pre>s on CSS and JS pages (new
-  classes: mw-code, mw-css, mw-js)
+* (bug 10196) Add classes and dir="ltr" to <div>s wrapping CSS and JS pages
+  (new classes: mw-code, mw-css, mw-js)
 * (bug 6711) Add $wgAddGroups and $wgRemoveGroups to allow finer control over
   usergroup assignment.
 * Introduce 'UserEffectiveGroups' hook; see docs/hooks.txt for more information
 * (bug 10387) Detect and handle '.php5' extension environments at install time
   Patch by Edward Z. Yang.
-* Introduce 'ShowRawCssJs' hook; see docs/hooks.txt for more information
-* (bug 10404) Show rights log fragment for the selected user in Special:Userrights
-* New javascript for upload page that will show a warning if a file with the "destination filename" already exists.
+* (bug 10404) Show rights log for the selected user in Special:Userrights
+* New javascript for upload page that will show a warning if a file with the
+  "destination filename" already exists.
+* (bug 10422) Do not wrap user JS/CSS in <pre>; allow it to render as wikitext.
+  like site CSS/JS.
 
 == Bugfixes since 1.10 ==
 
index a74591a..6f188e9 100644 (file)
@@ -656,14 +656,9 @@ $content_actions: The array of content actions
                     Can be used to set custom CSS/JS
 $out: OutputPage object
 
-'ShowRawCssJs': Customise the output of raw CSS and JavaScript in page views
-$text: Text being shown
-$title: Title of the custom script/stylesheet page
-$output: Current OutputPage object
-
 'AjaxAddScript': Called in output page just before the initialisation
 of the javascript ajax engine. The hook is only called when ajax
 is enabled ( $wgUseAjax = true; ).
 
 More hooks might be available but undocumented, you can execute
-./maintenance/findhooks.php to find hidden one.
\ No newline at end of file
+./maintenance/findhooks.php to find hidden one.
index 9f3795e..58de866 100644 (file)
@@ -784,15 +784,12 @@ class Article {
                        if( $this->mTitle->isCssOrJsPage() || $this->mTitle->isCssJsSubpage() ) {
                                $wgOut->addHtml( wfMsgExt( 'clearyourcache', 'parse' ) );
 
-                               // Give hooks a chance to customise the output
-                               if( wfRunHooks( 'ShowRawCssJs', array( $this->mContent, $this->mTitle, $wgOut ) ) ) {
-                                       // Wrap the whole lot in a <pre> and don't parse
-                                       preg_match( '!\.(css|js)$!u', $this->mTitle->getText(), $m );
-                                       $wgOut->addHtml( "<pre class=\"mw-code mw-{$m[1]}\" dir=\"ltr\">\n" );
-                                       $wgOut->addHtml( htmlspecialchars( $this->mContent ) );
-                                       $wgOut->addHtml( "\n</pre>\n" );
-                               }
-                       
+                               // Add classes, give directionality.  Do parse it as wikitext
+                               // (bug 10422).
+                               preg_match( '!\.(css|js)$!u', $this->mTitle->getText(), $m );
+                               $wgOut->addHtml( "<div class=\"mw-code mw-{$m[1]}\" dir=\"ltr\">\n" );
+                               $wgOut->addWikiText( $this->mContent );
+                               $wgOut->addHtml( "\n</div>\n" );
                        }
                        
                        elseif ( $rt = Title::newFromRedirect( $text ) ) {