Skip to content

Highlight

Wraps all instances of a specific string, within a given string, with an HTML <strong> tag with a class attribute of highlight.

Example

liquid
  {{ That is 'first product' | highlight: search.terms }}

Output

This is the <strong class="highlight">first product</strong>