You've already forked joplin
							
							
				mirror of
				https://github.com/laurent22/joplin.git
				synced 2025-10-31 00:07:48 +02:00 
			
		
		
		
	Desktop: Fixes #9958: Highlight partial matches in search results
This commit is contained in:
		| @@ -24,10 +24,17 @@ markJsUtils.markKeyword = (mark, keyword, stringUtils, extraOptions = null) => { | ||||
| 	const isBasicSearch = ['ja', 'zh', 'ko'].indexOf(keyword.scriptType) >= 0; | ||||
|  | ||||
| 	let value = keyword.value; | ||||
| 	let accuracy = keyword.accuracy ? keyword.accuracy : { value: 'exactly', limiters: ':;.,-–—‒_(){}[]!\'"+='.split('') }; | ||||
| 	if (isBasicSearch) accuracy = 'partially'; | ||||
|  | ||||
| 	const getAccuracy = (keyword) => { | ||||
| 		if (isBasicSearch) return 'partially'; | ||||
| 		if (keyword.type === 'regex') return 'complementary'; | ||||
| 		if (keyword.accuracy) return keyword.accuracy; | ||||
| 		return keyword.value.length >= 2 ? 'partially' : { value: 'exactly', limiters: ':;.,-–—‒_(){}[]!\'"+='.split('') }; | ||||
| 	}; | ||||
|  | ||||
| 	const accuracy = getAccuracy(keyword); | ||||
|  | ||||
| 	if (keyword.type === 'regex') { | ||||
| 		accuracy = 'complementary'; | ||||
| 		// Remove the trailing wildcard and "accuracy = complementary" will take | ||||
| 		// care of highlighting the relevant keywords. | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user