Hi @shikhasoni1 ,
To achieve the above scenario you have to follow 3 steps.
step1-using this it will add aria-label in anchor tag in crx/de but you will not be able to retrieve it in dialog
- Copy /libs/cq/xssprotection/config.xml to /apps/cq/xssprotection/config.xml.
- Open /apps/cq/xssprotection/config.xml. In the common-attributes section, add the following target attribute declaration.
<attribute name="aria-label>
<regexp-list> <regexp value="[a-zA-Z0-9-_\$]+" />
</regexp-list>
</attribute> - Find the tag declaration by searching the term <tag name="a" >
- Add the line below in the list of attributes: <attribute name="aria-label" />
- use below link to add the js
http://experience-aem.blogspot.com/2017/09/aem-63-touch-ui-extend-rich-text-link-dialog-add-rel-select.html
After doing the above steps you will get the below error in error.log
org.apache.sling.xss.impl.HtmlToHtmlContentContext AntiSamy warning: The a tag contained an attribute that we could not process. Thearia-label attribute had a value of "bookmark"
step2- To avoid RTE editor to strip them, I have disabled xss filtering for dialog by adding the property to the text node usinng disableXSSFilteringproperty {Boolean}true
step3-To avoid DOM to strip aria-label, content="unsafe" You should add in your html code