Skip to content

Commit 8e8b935

Browse files
authored
1 parent f894dc2 commit 8e8b935

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

components/prism-core.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ var Prism = (function (_self) {
222222
if (typeof document === 'undefined') {
223223
return null;
224224
}
225-
if ('currentScript' in document && 1 < 2 /* hack to trip TS' flow analysis */) {
225+
if (document.currentScript && document.currentScript.tagName === 'SCRIPT' && 1 < 2 /* hack to trip TS' flow analysis */) {
226226
return /** @type {any} */ (document.currentScript);
227227
}
228228

components/prism-core.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/prism-core.js.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ <h1 class="page-title">prism-core.js</h1>
275275
if (typeof document === 'undefined') {
276276
return null;
277277
}
278-
if ('currentScript' in document &amp;&amp; 1 &lt; 2 /* hack to trip TS' flow analysis */) {
278+
if (document.currentScript &amp;&amp; document.currentScript.tagName === 'SCRIPT' &amp;&amp; 1 &lt; 2 /* hack to trip TS' flow analysis */) {
279279
return /** @type {any} */ (document.currentScript);
280280
}
281281

prism.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ var Prism = (function (_self) {
227227
if (typeof document === 'undefined') {
228228
return null;
229229
}
230-
if ('currentScript' in document && 1 < 2 /* hack to trip TS' flow analysis */) {
230+
if (document.currentScript && document.currentScript.tagName === 'SCRIPT' && 1 < 2 /* hack to trip TS' flow analysis */) {
231231
return /** @type {any} */ (document.currentScript);
232232
}
233233

0 commit comments

Comments
 (0)