Force RemexHtml as Tidy driver and add an option to disable tidying

This commit is contained in:
Luqgreg 2018-08-18 18:40:36 +02:00
parent e51204ff8b
commit 8a93653f0b
2 changed files with 8 additions and 4 deletions

View file

@ -12,7 +12,8 @@
"config": { "config": {
"AllInfoboxesMiserMode": true, "AllInfoboxesMiserMode": true,
"AllInfoboxesSubpagesBlacklist": [ "doc", "draft", "test" ], "AllInfoboxesSubpagesBlacklist": [ "doc", "draft", "test" ],
"PortableInfoboxCustomImageWidth": 300 "PortableInfoboxCustomImageWidth": 300,
"PortableInfoboxUseTidy": true
}, },
"MessagesDirs": { "MessagesDirs": {
"PortableInfobox": "i18n" "PortableInfobox": "i18n"

View file

@ -9,13 +9,16 @@ class MediaWikiParserService implements ExternalParser {
protected $tidyDriver; protected $tidyDriver;
public function __construct( \Parser $parser, \PPFrame $frame ) { public function __construct( \Parser $parser, \PPFrame $frame ) {
global $wgTidyConfig; global $wgPortableInfoboxUseTidy;
$this->parser = $parser; $this->parser = $parser;
$this->frame = $frame; $this->frame = $frame;
if ( $wgTidyConfig !== null ) { if ( $wgPortableInfoboxUseTidy ) {
$this->tidyDriver = \MWTidy::factory( array_merge( $wgTidyConfig, [ 'pwrap' => false ] ) ); $this->tidyDriver = \MWTidy::factory( [
'driver' => 'RemexHtml',
'pwrap' => false
] );
} }
} }