mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-14 11:15:13 +00:00
Don't configure parser-factory-callback
Configuring parser-factory-callback is not necessary here because it's the same as the default for the string value type. Setting a data type specific custom parser will soon allow for data type specific overrides of the parser whenever a statement value is deserialized, and setting it may result in additional data type lookups. Bug: T360603 Change-Id: I6a859b8d9cf25d8a837b366434380169e404fe6b
This commit is contained in:
parent
dac2a3267a
commit
22a3e5fc55
|
@ -2,10 +2,7 @@
|
||||||
|
|
||||||
namespace MediaWiki\Extension\Math;
|
namespace MediaWiki\Extension\Math;
|
||||||
|
|
||||||
use ParserOptions;
|
|
||||||
use ValueFormatters\FormatterOptions;
|
use ValueFormatters\FormatterOptions;
|
||||||
use ValueParsers\StringParser;
|
|
||||||
use Wikibase\Repo\Parsers\WikibaseStringValueNormalizer;
|
|
||||||
use Wikibase\Repo\Rdf\DedupeBag;
|
use Wikibase\Repo\Rdf\DedupeBag;
|
||||||
use Wikibase\Repo\Rdf\EntityMentionListener;
|
use Wikibase\Repo\Rdf\EntityMentionListener;
|
||||||
use Wikibase\Repo\Rdf\RdfVocabulary;
|
use Wikibase\Repo\Rdf\RdfVocabulary;
|
||||||
|
@ -38,10 +35,6 @@ class WikibaseHook {
|
||||||
$validators[] = new MathValidator();
|
$validators[] = new MathValidator();
|
||||||
return $validators;
|
return $validators;
|
||||||
},
|
},
|
||||||
'parser-factory-callback' => static function ( ParserOptions $options ) {
|
|
||||||
$normalizer = new WikibaseStringValueNormalizer( WikibaseRepo::getStringNormalizer() );
|
|
||||||
return new StringParser( $normalizer );
|
|
||||||
},
|
|
||||||
'formatter-factory-callback' => static function ( $format, FormatterOptions $options ) {
|
'formatter-factory-callback' => static function ( $format, FormatterOptions $options ) {
|
||||||
return new MathFormatter( $format );
|
return new MathFormatter( $format );
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue