Highlighting text based on user input

Next issue…running into an issue where if the user enters a term which is in one of the HTML tags of the text85 element, it breaks the page display.
See screen shot. So the highlighting is working, but if any search term is part of an HTML tag, it really messes things up.
I’ve tried pulling only the .text and appending the HTML code, but it is just not working yet.