I have to show highlighted fragments out of html documents in a live search
element on a web page.
How do I achieve this?
When analysing the documents, I strip_html filter the html tags out of the
indexed document but the original source still contains the tags. This is
by intention, because I don't want to lose the tags, as I want to display
the full html text when user clicks on search hit.
But when displaying the highlighted fragment, the tags should be filtered
out of the fragment, except the highlighting tags.