-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve search (make fuzzy again and more robust) #932
Changes from all commits
0384956
39c2ca3
8be7291
38e72e0
147fd00
cd70b64
3b95628
5f9767b
2278d1f
4e235fd
bc549ac
5c8a253
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
import PopupMenu from './PopupMenu'; | ||
|
||
import Search from '../search'; | ||
|
||
|
||
/** | ||
* @type { import('didi').ModuleDeclaration } | ||
*/ | ||
export default { | ||
__depends__: [ Search ], | ||
__init__: [ 'popupMenu' ], | ||
popupMenu: [ 'type', PopupMenu ] | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -523,10 +523,13 @@ function createHtmlText(tokens) { | |
var htmlText = ''; | ||
|
||
tokens.forEach(function(t) { | ||
if (t.matched) { | ||
htmlText += '<b class="' + SearchPad.RESULT_HIGHLIGHT_CLASS + '">' + escapeHTML(t.matched) + '</b>'; | ||
var text = escapeHTML(t.value || t.matched || t.normal); | ||
var match = t.match || t.matched; | ||
|
||
if (match) { | ||
htmlText += '<b class="' + SearchPad.RESULT_HIGHLIGHT_CLASS + '">' + text + '</b>'; | ||
} else { | ||
htmlText += escapeHTML(t.normal); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, that is a bug. 👍 Of course There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
htmlText += text; | ||
} | ||
}); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have some type definition for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also missing here, good catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed via f1a8efe.