* @ingroup Content
*/
class CssContent extends TextContent {
+
+ /**
+ * @param string $text CSS code.
+ */
public function __construct( $text ) {
parent::__construct( $text, CONTENT_MODEL_CSS );
}
* Returns a Content object with pre-save transformations applied using
* Parser::preSaveTransform().
*
- * @param $title Title
- * @param $user User
- * @param $popts ParserOptions
- * @return Content
+ * @param Title $title
+ * @param User $user
+ * @param ParserOptions $popts
+ *
+ * @return CssContent
+ *
+ * @see TextContent::preSaveTransform
*/
public function preSaveTransform( Title $title, User $user, ParserOptions $popts ) {
global $wgParser;
return new CssContent( $pst );
}
+ /**
+ * @return string CSS wrapped in a <pre> tag.
+ */
protected function getHtml() {
$html = "";
$html .= "<pre class=\"mw-code mw-css\" dir=\"ltr\">\n";
- $html .= $this->getHighlightHtml();
+ $html .= htmlspecialchars( $this->getNativeData() );
$html .= "\n</pre>\n";
return $html;
}
+
}