search_suggestion: Move search description html into helper function.

This will be used elsewhere in upcoming commits.
This commit is contained in:
Evy Kassirer
2025-06-04 21:45:17 -07:00
committed by Tim Abbott
parent a35f166fac
commit 0e86b01c5b

View File

@@ -1029,6 +1029,10 @@ class Attacher {
}
}
export function search_term_description_html(item: NarrowTerm): string {
return `search for ${Handlebars.Utils.escapeExpression(item.operand)}`;
}
export function get_search_result(
pill_search_terms: NarrowTerm[],
text_search_terms: NarrowTerm[],
@@ -1083,7 +1087,7 @@ export function get_search_result(
suggestion_line = [
{
search_string: last.operand,
description_html: `search for ${Handlebars.Utils.escapeExpression(last.operand)}`,
description_html: search_term_description_html(last),
is_people: false,
},
];