Merge "mediawiki.searchSuggest: Show full article title as a tooltip for each suggestion"
[lhc/web/wiklou.git] / includes / content / JavaScriptContent.php
index 2ae572b..442b705 100644 (file)
  * @ingroup Content
  */
 class JavaScriptContent extends TextContent {
+
+       /**
+        * @param string $text JavaScript code.
+        */
        public function __construct( $text ) {
                parent::__construct( $text, CONTENT_MODEL_JAVASCRIPT );
        }
@@ -42,7 +46,8 @@ class JavaScriptContent extends TextContent {
         * @param Title $title
         * @param User $user
         * @param ParserOptions $popts
-        * @return Content
+        *
+        * @return JavaScriptContent
         */
        public function preSaveTransform( Title $title, User $user, ParserOptions $popts ) {
                global $wgParser;
@@ -55,12 +60,16 @@ class JavaScriptContent extends TextContent {
                return new JavaScriptContent( $pst );
        }
 
+       /**
+        * @return string JavaScript wrapped in a <pre> tag.
+        */
        protected function getHtml() {
                $html = "";
                $html .= "<pre class=\"mw-code mw-js\" dir=\"ltr\">\n";
-               $html .= $this->getHighlightHtml();
+               $html .= htmlspecialchars( $this->getNativeData() );
                $html .= "\n</pre>\n";
 
                return $html;
        }
+
 }