1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00

All: Fix text highlighting in basic search mode (#13703)

This commit is contained in:
Self Not Found
2025-11-17 22:01:22 +00:00
committed by GitHub
parent 0e135adbe2
commit c67dcebbbe
3 changed files with 5 additions and 1 deletions

View File

@@ -474,6 +474,7 @@ describe('services/SearchEngine', () => {
['"abcd efgh"', { _: ['abcd efgh'] }], ['"abcd efgh"', { _: ['abcd efgh'] }],
['"abcd efgh" ijkl', { _: ['abcd efgh', 'ijkl'] }], ['"abcd efgh" ijkl', { _: ['abcd efgh', 'ijkl'] }],
['title:abcd title:efgh', { title: ['abcd', 'efgh'] }], ['title:abcd title:efgh', { title: ['abcd', 'efgh'] }],
['/abcd', { _: ['abcd'] }],
]; ];
for (let i = 0; i < testCases.length; i++) { for (let i = 0; i < testCases.length; i++) {

View File

@@ -544,6 +544,10 @@ export default class SearchEngine {
let allTerms: Term[] = []; let allTerms: Term[] = [];
if (query.length && query[0] === '/') {
query = query.substring(1);
}
try { try {
allTerms = filterParser(query); allTerms = filterParser(query);
} catch (error) { } catch (error) {

View File

@@ -20,7 +20,6 @@ export default class SearchEngineUtils {
let searchType = SearchEngine.SEARCH_TYPE_FTS; let searchType = SearchEngine.SEARCH_TYPE_FTS;
if (query.length && query[0] === '/') { if (query.length && query[0] === '/') {
query = query.substr(1);
searchType = SearchEngine.SEARCH_TYPE_BASIC; searchType = SearchEngine.SEARCH_TYPE_BASIC;
} }