in reply to HTML to text

In addition to the points raised by others, this would fail to account for character references in the markup.

The quick & the dead

Or greater than characters in attribute values

<p title="x > y">