added an HTML conversion option and trim the end of text lines because out-string adds newlines