mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-28 02:00:25 +00:00
Force RemexHtml as Tidy driver and add an option to disable tidying
This commit is contained in:
parent
e51204ff8b
commit
8a93653f0b
|
@ -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"
|
||||||
|
|
|
@ -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
|
||||||
|
] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue