X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fparser%2FParserOutput.php;h=19375e0c2199d9629eaee9e1be10b29bacc7c1af;hp=ff9c28d2bbd8bad6acb7c15710cbb05d7df174da;hb=ee56f00ddf0609082f8ae9a4dc3e6e1b6f54ddfd;hpb=6eb558b5e05d329067e9080b3502e2b5b7d5bd60
diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php
index ff9c28d2bb..19375e0c21 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
@@ -266,29 +268,60 @@ 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