Display Formatted json String in Perspective

Is there a way to take a json string and display it formatted on a Perspective view? Quick search shows some javascript to pretty a json string, but I am not sure how to do that in Perspective.

There’s a jsonFormat expression function.

Some ideas in this thread: