Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Linkchecker replacing href from <a> tag

Avatar

Not applicable

Hi,

 

We have created a component similar to an RTE component. when dragged on page, It enables the user to enter some Java script or CSS and write HTML to create custom content as per the users requirement. Now we are sending the details of the page in JSON to front end system. The JSON is generated using custom query builder. that is based on query builder available OOB. 

In the component, I am adding the HTML code as: <a href="http://google.com"> Testing</a>

When I hit the URL to create the JSON, this is the value from server before it hits client: 

{"hits":[{"jcr:primaryType":"nt:unstructured","htmlBlock":"<a  href="http://google.com"> Testing</a>","jcr:lastModifiedBy":"admin","moduleType":"rwdHtmlPromoModule","name":"promo","jcr:lastModified":"Thu Nov 05 2015 17:22:28 GMT+0530",":moduleUrl":"/content/Assets/Reference-Components/html-promo-modules/promo-1/jcr:content/htmlpromomodule","sling:resourceType":"webcms-ngtv/components/content/htmlPromoModule","parentPath":"/content/-Assets/Reference-Components/html-promo-modules/promo-1"}]}

 

but when the json is displayed on the browser link checker removes the href value and inserts some code of itself that says the link is invalid. the resulting json is:

{"hits":[{"jcr:primaryType":"nt:unstructured","htmlBlock":"<img src="/libs/cq/linkchecker/resources/linkcheck_o.gif" alt="invalid link: skip\" title="invalid link: skip\" border="0"> Testing</a>","jcr:lastModifiedBy":"admin","moduleType":"rwdHtmlPromoModule","name":"promo","jcr:lastModified":"Thu Nov 05 2015 17:22:28 GMT+0530",":moduleUrl":"/content/Assets/Reference-Components/html-promo-modules/promo-1/jcr:content/htmlpromomodule","sling:resourceType":"webcms-ngtv/components/content/htmlPromoModule","parentPath":"/content/Assets/Reference-Components/html-promo-modules/promo-1"}]}

 

I tried disabling the linkchecker but still getting the same result. I have added the pattern as exception in one of the configurators for linkchecker but still no success. 

 

Any pointers whats going wrong in this..??

 

Thanks,

Anuj Rattan

1 Accepted Solution

Avatar

Correct answer by
Level 10
What AEM version are you using. If using 6; have you considered SightLy?  Is backend a custom OSGI service?  The link checker typically will not change markup generated by a backend service.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10
What AEM version are you using. If using 6; have you considered SightLy?  Is backend a custom OSGI service?  The link checker typically will not change markup generated by a backend service.