36use Wikimedia\Minify\CSSMin;
58 return CssContent::class;
78 return new $class(
'/* #REDIRECT */@import ' . CSSMin::buildUrlValue(
$url ) .
';' );
85 '@phan-var CssContent $content';
89 if ( !$services->getUserOptionsLookup()->getBoolOption( $pstParams->
getUser(),
'pst-cssjs' ) ) {
92 $popts->setPreSaveTransform(
false );
95 $text = $content->getText();
96 $pst = $services->getParserFactory()->getInstance()->preSaveTransform(
104 return new $class( $pst );
117 '@phan-var CssContent $content';
118 if ( in_array( $content->
getModel(), $textModelsToParse ) ) {
124 WikiPage::makeParserOptionsFromTitleAndModel(
139 [
'class' =>
'mw-code mw-css',
'dir' =>
'ltr' ],
140 "\n" . $content->getText() .
"\n"
154class_alias( CssContentHandler::class,
'CssContentHandler' );
const CONTENT_FORMAT_CSS
For CSS pages.
Content handler for code content such as CSS, JavaScript, JSON, etc.
Content handler for CSS pages.
preSaveTransform(Content $content, PreSaveTransformParams $pstParams)
Returns a $content object with pre-save transformations applied (or the same object if no transformat...
supportsRedirects()
Returns true if this content model supports redirects.
__construct( $modelId=CONTENT_MODEL_CSS)
fillParserOutput(Content $content, ContentParseParams $cpoParams, ParserOutput &$output)
Fills the provided ParserOutput object with information derived from the content.Unless $generateHtml...
makeRedirectContent(Title $destination, $text='')
Create a redirect that is also valid CSS.
A class containing constants representing the names of configuration variables.
const TextModelsToParse
Name constant for the TextModelsToParse setting, for use with Config::get()
Base representation for an editable wiki page.
Base interface for representing page content.
getModel()
Returns the ID of the content model used by this Content object.