The highlight text function is designed to enhance the readability and user experience of search results by visually highlighting the text that matches the search query. This function takes two parameters: the search query entered by the user and the text content of each search result. It then scans through the search result text to identify occurrences of the search query and applies a formatting style to highlight these occurrences.
- Unused code removed