pretty-print JSON in show-template if valid JSON, else return raw string.