34use Wikimedia\Minify\CSSMin;
56 return CssContent::class;
76 return new $class(
'/* #REDIRECT */@import ' . CSSMin::buildUrlValue(
$url ) .
';' );
83 '@phan-var CssContent $content';
87 if ( !$services->getUserOptionsLookup()->getBoolOption( $pstParams->
getUser(),
'pst-cssjs' ) ) {
90 $popts->setPreSaveTransform(
false );
93 $text = $content->getText();
94 $pst = $services->getParserFactory()->getInstance()->preSaveTransform(
102 return new $class( $pst );
115 '@phan-var CssContent $content';
116 if ( in_array( $content->
getModel(), $textModelsToParse ) ) {
122 WikiPage::makeParserOptionsFromTitleAndModel(
137 [
'class' =>
'mw-code mw-css',
'dir' =>
'ltr' ],
138 "\n" . $content->getText() .
"\n"
152class_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.