Rich Text Editor problem id's removed

I have an app where I edit HTML content, and in the contents, I have anchors.

<h2 id="my-section-1">Section 1</h2>
<div> bla bla bla</div>

When this is loaded into a Rich Text Editor component, the ids are removed. :frowning:

<h2>Section 1</h2>
<div> bla bla bla</div>

Do you have a solution to prevent this removal of attributes ? :thinking:

Thanks :pray:

@Manuel Hi Manuel, thank you for reaching out. The only way that I was able to get this to work is by replacing the opening and closing HTML tags with HTML entities as shown below:

var value = `<h2 id="my-section-1">Section 1</h2>
<div>bla bla bla</div>`

return value.replace(/</g, '&lt;').replace(/>/g, '&gt;');

That should then display as expected:

You can set up a transformer in Retool to prep the data before passing it to your rich text editor. Let me know if you have any other questions!