[BUGFIX beta] Normalize HTML string for IE8

This fixes are specified for IE8.

* Force HTML tag to lowercase.
* Add several `class` to be quoted
* Trim newline at the beggining of HTML tag
Merge pull request #4929 from tricknotes/fix-for-ie8

[BUGFIX beta] Normalize HTML string for IE8