Forum Discussion

djondinium's avatar
4 years ago

Remove highlight class from messages.search_snippet

Hello all, We have a custom homepage component built that is showing a few latest threads from our Announcement board. Simple stuff. The problem is that the 'search_snippet' is highlighting the...
  • MattV's avatar
    4 years ago

    The "search_snippet" is doing exactly what it is intended to do. So usually don't recommend using that field for that reason (unless to display search results). 

    Otherwise... options include:

    1. Use messages.body instead; then trim HTML with utils.owasp freemarker context object, then trim to X number of characters.
    2. Taking the HTML of messages.search_snippet and doing a ?replace("lia-search-match-lithium","") on the string