Use document.currentScript instead of document.getElementsByTagName()
diff --git a/components/prism-core.js b/components/prism-core.js
index 50d5fbc..e8ece18 100644
--- a/components/prism-core.js
+++ b/components/prism-core.js
@@ -410,10 +410,8 @@ if (!_self.document) {
return _self.Prism;
}
-// Get current script and highlight
-var script = document.getElementsByTagName('script');
-
-script = script[script.length - 1];
+//Get current script and highlight
+var script = document.currentScript || [].slice.call(document.getElementsByTagName("script")).pop();
if (script) {
_.filename = script.src;