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": {
"AllInfoboxesMiserMode": true,
"AllInfoboxesSubpagesBlacklist": [ "doc", "draft", "test" ],
"PortableInfoboxCustomImageWidth": 300
"PortableInfoboxCustomImageWidth": 300,
"PortableInfoboxUseTidy": true
},
"MessagesDirs": {
"PortableInfobox": "i18n"

View file

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