alexdunae/premailer — pull request #156 by rustyio (2013-05-30 15:36:09+00:00)
Title: Correctly handle encoded angle brackets.

`HtmlToPlainText#convert_to_text` clobbers all text between the html entities "&lt;" and "&gt;".

This is because we do entity replacement, converting the entities into angle brackets, and then strip out remaining tags.

This commit fixes the issue by doing entity replacement **after** we strip out tags.

Before this commit:

```ruby
Premailer.new("<test>", :with_html_string => true).to_plain_text
# Erroneously returns ""
```

After this commit:

```ruby
Premailer.new("<test>", :with_html_string => true).to_plain_text
# Correctly returns ""
```