Instead of searching inside the actual HTML file, search for browsers on the rendered output of that HTML.
Get the appropriate HTML renderer and get its output as text. Then search on that text output using the appropriate string search algorithms.
The example you highlighted in your question will result in a newline character in the displayed HTML output, and therefore the normal string search algorithm will behave as you expect.
source
share