-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: Strip HTML from rich text search results #3783
Conversation
@@ -27,6 +33,7 @@ export const useSearch = <T extends object>({ | |||
useExtendedSearch: true, | |||
includeMatches: true, | |||
minMatchCharLength: 3, | |||
ignoreLocation: true, |
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.
By default, just the first 60 characters are searched which was giving me some unexpected false negative results.
The testing I've done doesn't make this feel much slower performance-wise - will flag this when this PR is tested.
Removed vultr server and associated DNS entries |
a7aa02a
to
d80c5f8
Compare
1c631c2
to
9298ae6
Compare
@@ -307,7 +241,7 @@ const defaultFormatter: SearchResultFormatter = { | |||
getIconKey: ({ item }) => item.type, | |||
getTitle: ({ item }) => | |||
(item.data?.title as string) || (item.data?.text as string) || "", | |||
getHeadline: ({ item, key }) => get(item, key)?.toString() || "", | |||
getHeadline: ({ matchValue }) => matchValue, |
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.
This is a nice simplification! Rather than try to reverse engineer the match back via multiple different getHeadline()
methods, we can just use the original matchValue
which fuse.js used.
Looks nice and clean without the markdown in the search result :) I do find it a bit odd that several seemingly unrelated strings are sometimes thrown up in bold (e.g |
What does this PR do?
SearchResultCard