AEM 6 | richtext xtype removing html element's attribute | Community
Skip to main content
Radha_Krishna_N
Level 3
October 16, 2015
Solved

AEM 6 | richtext xtype removing html element's attribute

  • October 16, 2015
  • 2 replies
  • 1826 views

Hi,

I have a component developed in AEM 6. one of the field has richtext as xtype. The issue I am facing is when I author this field with html data(using source edit), on the page some of the HTML element attributes are getting removed.

 

for example,

If I add below html code

<div data-hide="...">some content</div>

and when I veiw the source of finally rendered HTML page, data-hide property is missing!!

 

how to resolve this issue?

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

Hi Radha Krishna,

   Currently only supports the basic html tags and not custom one. Verify html serializer/processor /at libs/cq/ui/widgets/source/widgets/form/rte . This basically means that unsupported HTML that was entered will get stripped/removed.

As a workaround, i will suggest that you create a custom plain HTML component that is suitable for your use case and not use the Richtext. Another possibility is to create a new plugin to support such a use case.

Thanks,
Sham
 Tweet: @adobe_sham

2 replies

Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015

Hi Radha Krishna,

   Currently only supports the basic html tags and not custom one. Verify html serializer/processor /at libs/cq/ui/widgets/source/widgets/form/rte . This basically means that unsupported HTML that was entered will get stripped/removed.

As a workaround, i will suggest that you create a custom plain HTML component that is suitable for your use case and not use the Richtext. Another possibility is to create a new plugin to support such a use case.

Thanks,
Sham
 Tweet: @adobe_sham

smacdonald2008
Level 10
October 16, 2015

Is the element hidden or gone - for example -- if you use JQuery for example to read the element:

var $dvObj = $('div.desc');

is a value returned?