mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-23 23:33:54 +00:00
Allow overriding the search pattern highlighting for Wikibase
Use a php hook to override the highlightQuery attribute. This allows us to turn off search higlighting for all wikibase repo instances. Bug: T327510 Change-Id: I0ef27da9cf4ac66151d1a391e9f606100097d7f0
This commit is contained in:
parent
274c97acb5
commit
2c96f9b3d7
|
@ -96,11 +96,17 @@ class Hooks implements
|
|||
RL\Context $context,
|
||||
Config $config
|
||||
): array {
|
||||
$result = $config->get( 'VectorWvuiSearchOptions' );
|
||||
$result['highlightQuery'] =
|
||||
VectorServices::getLanguageService()->canWordsBeSplitSafely( $context->getLanguage() );
|
||||
$vectorSearchConfig = [
|
||||
'highlightQuery' =>
|
||||
VectorServices::getLanguageService()->canWordsBeSplitSafely( $context->getLanguage() )
|
||||
];
|
||||
|
||||
return $result;
|
||||
MediaWikiServices::getInstance()->getHookContainer()->run(
|
||||
'VectorSearchResourceLoaderConfig',
|
||||
[ &$vectorSearchConfig ]
|
||||
);
|
||||
|
||||
return array_merge( $config->get( 'VectorWvuiSearchOptions' ), $vectorSearchConfig );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue