highlight
Encloses all occurrences of a specified string within a provided string with an HTML <strong> tag, applying a highlight class to the tag.
Parameters
str{String}: The input string. This parameter is required.search{String}: The search value. This parameter is required.returns{String}: The HTML string.
Usage
{{{highlight str search}}}
Example
{{#each search.results as |item|}}
{{#if item.object_type '==' 'product'}}
{{{ highlight item.description ../search.terms }}}
{{else}}
{{{ highlight item.content ../search.terms }}}
{{/if}}
{{/each}}
Was this article helpful to you?