[SalesForce] How to render text as HTML on a page

I am currently working within a Lightning Component where I have returned the contents of a rich text field from a knowledge article to a <div> section of the page. Instead of the browser rendering the rich text contents as HTML, it is being rendered only as text, which also displays all of the HTML markup on the page.

Since I am working in a Lightning component I do not seem to have access to functions such as {!HTMLENCODE}, but I'm not sure if that is what I would be looking for anyway. I not sure if there is some way I can convert the rich text content to HTML characters either in the Apex controller or on the client side before displaying it to the page?

Thank you everyone. I look forward to any information you can provide.

I have attached a screenshot for reference.enter image description here

Best Answer

To output pre-formatted HTML, use aura:unescapedHTML.

You can pass in values from a controller, such as:

<aura:unescapedHtml value="{!v.note.body}"/>