Merge pull request #81 from mrvdb/codehighlight

Resolve an edge case where last language has error
pull/89/head
Matt Baer 6 years ago committed by GitHub
commit 2f683e783e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      templates/include/post-render.tmpl

@ -22,8 +22,12 @@
var sc = document.createElement('script');
sc.src = uri;
sc.async = false; // critical?
// Set callback on last script
if (uris.indexOf(uri) == uris.length-1) {
sc.onload = callback;
// Set callback regardless
// so we're sure it will run if last element had error
// (we only know after loading, so we've had load time already)
sc.onload = callback; sc.onerror = callback;
}
document.head.appendChild(sc);
});

Loading…
Cancel
Save