Refactored and fixed the search_html helper.