Code component that renders text as HTML

When you use a standard Text component, there is an option “HTML” that renders the contents as HTML.

Is there a way to do this for a code component? I have a component that outputs HTML, but it is rendering text with html tags

if(contentObject !== null || typeof contentObject === 'string') {
        // replace markdown with html
        const md = new Remarkable();
        content = md.render(contentObject);
    }
    return <div className={className + ' text-left w-full py-1'}>{content}</div>;

Screenshot 2025-01-08 at 17.12.05

Hello @nick_dart, you can use the dangerouslySetInnerHTML attribute:

<div dangerouslySetInnerHTML={{ __html: content}} />

Before using this, ensure that the content string is sanitized if it comes from an untrusted source. You can use libraries to sanitize your HTML to remove any malicious scripts.