Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

RTE issue - HTML elements getting stripped off when added inside the table <td> attribute in AEM - 6.3


Level 2

We have extended the core text component in our website.

When I author an image / hyperlink inside the table <td> attribute in RTE, the image / hyperlink gets removed from the DOM on submission(image is not displayed and image tag is removed from the html).

When I add the image/hyperlink outside the table, its getting displayed. Please let me know if anyone has faced the similar issue.

@Vijayalakshmi_S  @arunpatidar @Suraj_Kamdi 

5 Replies


Community Advisor

@Vanitha_Duraisamy Trying customizing the "/libs/clientlibs/granite/richtext/core/js/HtmlSerializer.js" the one stripping out the src attribute from the img tag.

Please refer, there is a similar thread for this https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/script-issue-with-rte/m-p/...





Hi @Vanitha_Duraisamy,

If its being saved properly in jcr and attributes are not showing in RTE editor, then you might need to disable XSS filtering in your edit dialog. You can do this for RTE by adding the proeprty disableXSSfiltering={Boolean}true to your text node (where the sling resource type for RTE is).



Level 2

Thanks @vanegi 

Tried this but still the issue exists.

The dialog values are getting stored in JCR and I can view the image in dialog as well, On submission the <img> tag gets stripped out.



After Submission:



I also tried adding the below code directly in the component HTML file, same issue is happening. 

Even if I add <a href> element instead of <img> element, that also gets stripped off.


</tr><tr><td><img src="img.png" alt=""></td>


We don't have any URL transformer in our site. I even tried disabling the ootb link checker configuration, still the issue persists.

Thanks @Shailesh_Bassi_  - This doesn't seems like rte issue



Can you share the source code, and attach the screenshot of the node wherein you have added this property "disableXSSfiltering"? You can also check /libs/cq/xssprotection/config.xml for img tag valid rules.


Level 2


Please find the screenshot-


We have just extended the core text component and we haven't done any customizations.