AEM 6.3 Custom RTE dialog truncates the additional parameters of anchor tag

suniln13212398 01-12-2018

Issue:

We have developed custom RTE link plugin where we could add additional parameters inside the anchor tag (like data-target, data-modal etc). On re-edit of the RTE the additional parameters are stripped/truncated.

Observations:

Step one: author the RTE dialog

Screen Shot 2018-12-01 at 3.12.07 AM.png

Step 2: Submit the RTE dialog. Content is properly stored in jcr content with additional parameters in the anchor tag

<p>A majority of Americans who are about to <a href="https://forums.adobe.com/content/test.html" data-target="#leavingModal" data-remote="false" data-toggle="modal">become</a> eligible for </p>

Step 3: Reopen the RTE Dialog, you wont see the additional parameters

Screen Shot 2018-12-01 at 3.18.51 AM.png

Question: Wondering why the RTE dialog is truncating/striping the additional parameters other than href and title. Can you please help me to identify where the truncating/striping is happening on RTE?

Accepted Solutions (1)

Accepted Solutions (1)

vipins5188 01-12-2018

Hi Sunil,

You need to add your custom parameter like data-target in xssprotection config file.

  1. Overlay /libs/cq/xssprotection/config.xml to /apps/cq/xssprotection/config.xml.
  2. Open /apps/cq/xssprotection/config.xml.
  3. In the common-attributes section, add the following attribute declaration.
  4. <attribute name="data-target ><regexp-list><regexp value="anything" /></regexp-list></attbribute>
  5. Find the a tag declaration by searching the term <tag name="a".
  6. Add the line below in the list of attributes:<attribute name="data-target" />

Add all your custom parameter and re-edit RTE dialog ,it should work fine.

Also make sure you have properly added login in dltToModel and dlgFromModel mtheods.

Hope this help.