Added functionality to render HTML or text giving an option.