RTE issue - HTML elements getting stripped off when added inside the table <td> attribute in AEM - 6.3 | Community
Skip to main content
Level 2
June 29, 2022

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

  • June 29, 2022
  • 2 replies
  • 1985 views

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 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

ShaileshBassi
Community Advisor
Community Advisor
June 29, 2022

@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/259337

Thanks

 

vanegi
Adobe Employee
Adobe Employee
June 29, 2022

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!!

Level 2
June 30, 2022

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.

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

vanegi
Adobe Employee
Adobe Employee
June 30, 2022

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.