Fix crash when text editor is empty

Only try to render as HTML when text editor is not empty
Preview as dock widget and support different CSS

Moved HTML preview to dock widget
Support different CSS styles for preview