Welcome Guest, Not a member yet? Register   Sign In
How not to highlight search query inside html tags?
#1

[eluser]Unknown[/eluser]
Hi, everybody.

Can't say, I am quite a novice to CI, but I was stopped by such a problem:
I have made a search system and I use the highlight_phrase() function from the text helper.

It seems to work fine, but there is also one nasty thing - in search results I can see highlighted even the "content" of HTML tags - say, names of files, urls and so on, if they match the search query, entered by the user.

Of cource, it breaks the page design as people see the HTML-code highlighted and it does not do what it must do (say, displaying an image, an url to some file)

Is there any way to overcome such a behaviour? Can I show the users the whole well-formatted page and highlight only those results which were found in the content out of <img> and <a> tags?

Thanks in advance.




Theme © iAndrew 2016 - Forum software by © MyBB