Loading HTML or markdown in a component

Through the use of a restful API I am getting the data and one of the variable I am getting is the body of a post. This var can be markdown or HTML depending on the post. Is there a way to effieciently render a view of the HTML or markdown other than InnerHTML? InnerHTML is buggy causing images to be all 1800 height and width.