Skip to content

Instantly share code, notes, and snippets.

@esquinas
Created August 2, 2019 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esquinas/acac3e92b189e5ec7f512294eb3ffeef to your computer and use it in GitHub Desktop.
Save esquinas/acac3e92b189e5ec7f512294eb3ffeef to your computer and use it in GitHub Desktop.
Used to prettify (make readable) JSON data returned by the WP JSON REST API, for example. Usage: copy & paste into your Chrome's console (in Firefox is built-in).
document.querySelector('pre').textContent = JSON.stringify(JSON.parse(document.querySelector('pre').textContent), null, 4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment