fgrehm/letter_opener_web — pull request #18 by kmcphillips (2013-12-07 16:22:46+00:00)
Title: Deal with empty href tags

The `adjust_link_targets` method uses an XML parser to find and rewrite `` tags to include the `target='_blank'`. If there is a link on the page that contains no content between the open and close tags the XML parser will convert it to a self closing tag. Most web browsers will auto-correct a self closing link tag to be just an opening tag and the remainder of the email will be highlighted as a link.

This:
```html

```

Becomes this:
```html

```

And is parsed as this:
```html

```

And that breaks the rest of the document.

The solution is to insert an empty string as text if the content of the node is `nil`.