Aem sling Rewriter for json values
Hi,
To meet our requirements I have implemented a filter in aem for certain path and is returning the json response from filter. Earlier I was facing issue with link rewriter removing the href invalid valid link from json even after disabling the disable link checking from aem link checker transformer OSGI configs.
To fix this I wrote a custom rewriter xml with custom generator and htmlparser generator and htmlwriter serializer. However in my custom transformer class whenever I am reading the href value for below [1] string it getting href as “\”. I believe it’s because we are using backslash to use quotes for href to get easily parsed on html. My html on json looks like
[1] {“message”: “this is text having href and aria-label <a href=\”/en/mypage.html \“ target=\”_blank\” aria-label=\”test\””}
Does any one has faced similar issue and was able to fix it?
NOTE: above html can’t be changed and used to remain as it is.
Not able to find any Apache documentation, what all different generators are allowed, I believe the reason is generator is converting the json strain in xml and as href starting value is \ so it’s read the href value as empty in sax parser


