You need to sign in to do that
Don't have an account?
Juan Blanco
Copy HTML content from Apex into a Rich Text Field removing unsupported tags
Hi all.
We want to copy certain HTML content (how we obtain that is not relevant for the question) into a field of type Rich Text Area (through a Apex code). Things "mostly" work, but the problem is that the Rich Text Area field does not accept/support all HTML tags, so those not supported appear as plain text. Is there an "automated" way, from Apex code, to remove the unsupported tags from the HTML? This would have to be some help class of some sort built directly by Salesforce I imagine, although the reason I am asking is because that code already exists "out there": it is exactly what happens in the UI if you copy HTML from somewhere and paste it into a Rich Text Area.
Thanks in advance for any insights on this.
We want to copy certain HTML content (how we obtain that is not relevant for the question) into a field of type Rich Text Area (through a Apex code). Things "mostly" work, but the problem is that the Rich Text Area field does not accept/support all HTML tags, so those not supported appear as plain text. Is there an "automated" way, from Apex code, to remove the unsupported tags from the HTML? This would have to be some help class of some sort built directly by Salesforce I imagine, although the reason I am asking is because that code already exists "out there": it is exactly what happens in the UI if you copy HTML from somewhere and paste it into a Rich Text Area.
Thanks in advance for any insights on this.