I want to transform this JSON:
{
"img":"/content/my/image/abc.png",
"text1":"hello <a href='https://google.com'>world</a>",
"text2":"hello <a href='/content/mypage.html'>world</a>"
}
Expected JSON output:
{
"img":"https://myserver.com/content/my/image/abc.png",
"text1":"hello <a class='external' href='https://google.com'>world</a>"
"text2":"hello <a class='internal' href='/content/mypage.html'>world</a>"
}
Basically I would like to add css class based on href value. Also add server address if img path is png. I could not find out how to achieve this. I see this but not very much sure it could be possible to do this.
The size of JSON could be around 5 MB which is coming as a response from Java Servlet and I want to transform this before the response is sent to the user.
Could you please suggest some links/examples how to do it?