Removed typeof undefined check to fix #1. Adds tests.

Fixes the underline tag not being closed properly.