Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wintersolutions/4f3471954db73bf2d8f4e0ab541cf724 to your computer and use it in GitHub Desktop.
Save wintersolutions/4f3471954db73bf2d8f4e0ab541cf724 to your computer and use it in GitHub Desktop.
document.querySelectorAll("pre code").forEach((element) =>
{
let html = element.outerHTML
let pattern = html.match(/\s*\n[\t\s]*/)
element.outerHTML = html.replace(new RegExp(pattern, "g"),'\n')
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment