correctly handle tag name replacement when replaced tags are not closed.
Added tests.
Merge pull request #37 from kalessin/replacement

correctly handle tag name replacement when replaced tags are not closed.