X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FParserOutput.php;h=8f0a1d7cc9fdee8ce6b7e25df035ca71beab29ad;hb=ec262cbb893e1675df9a87f4e41d3aa1a7d99156;hp=153a7708f4e50d93c020ca6c4650fac3503a84b6;hpb=1a40e0cc86b6ee0706606ded3ea243dfde4a414c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index 153a7708f4..8f0a1d7cc9 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -21,12 +21,14 @@ * @file * @ingroup Parser */ + class ParserOutput extends CacheTime { /** - * Feature flag to indicate to extensions that MediaWiki core supports and + * Feature flags to indicate to extensions that MediaWiki core supports and * uses getText() stateless transforms. */ const SUPPORTS_STATELESS_TRANSFORMS = 1; + const SUPPORTS_UNWRAP_TRANSFORM = 1; /** * @var string $mText The output text @@ -149,12 +151,6 @@ class ParserOutput extends CacheTime { */ public $mSections = []; - /** - * @deprecated since 1.31 Use getText() options. - * @var bool $mEditSectionTokens prefix/suffix markers if edit sections were output as tokens. - */ - public $mEditSectionTokens = true; - /** * @var array $mProperties Name/value pairs to be cached in the DB. */ @@ -170,12 +166,6 @@ class ParserOutput extends CacheTime { */ public $mTimestamp; - /** - * @deprecated since 1.31 Use getText() options. - * @var bool $mTOCEnabled Whether TOC should be shown, can't override __NOTOC__. - */ - public $mTOCEnabled = true; - /** * @var bool $mEnableOOUI Whether OOUI should be enabled. */ @@ -266,29 +256,47 @@ class ParserOutput extends CacheTime { * to generate one and `__NOTOC__` wasn't used. Default is true, * but might be statefully overridden. * - enableSectionEditLinks: (bool) Include section edit links, assuming - * section edit link tokens are present in the HTML. Default is true, + * section edit link tokens are present in the HTML. Default is true, * but might be statefully overridden. + * - unwrap: (bool) Remove a wrapping mw-parser-output div. Default is false. + * - deduplicateStyles: (bool) When true, which is the default, `#s', + function ( $m ) use ( &$seen ) { + $attr = Sanitizer::decodeTagAttributes( $m[1] ); + if ( !isset( $attr['data-mw-deduplicate'] ) ) { + return $m[0]; + } + + $key = $attr['data-mw-deduplicate']; + if ( !isset( $seen[$key] ) ) { + $seen[$key] = true; + return $m[0]; + } + + // We were going to use an empty