Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

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

Avatar

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

Avatar

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/...

Thanks

 

Avatar

Employee

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).

Thanks!!

Avatar

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.

Vanitha_Duraisamy_2-1656560790767.png

 

After Submission:

Vanitha_Duraisamy_1-1656560146854.png

 

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.

component.html

<table>
<tbody><tr><td>hey</td>
<td>hu</td>
</tr><tr><td><img src="img.png" alt=""></td>
<td>hi</td>
</tr></tbody>

</table>

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

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

Avatar

Employee

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.

Avatar

Level 2

@vanegi 

Please find the screenshot-

Vanitha_Duraisamy_0-1656573609999.png

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