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.
Or greater than characters in attribute values