Skip to content

Commit

Permalink
Core: Fixed scope problem in script mode (#2184)
Browse files Browse the repository at this point in the history
A function in Core was defined inside an `if` which isn't allowed in JS strict mode.
  • Loading branch information
RunDevelopment committed Jan 31, 2020
1 parent 0bf73dc commit 984e5d2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions components/prism-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,13 +582,13 @@ if (script) {
}
}

if (!_.manual) {
function highlightAutomaticallyCallback() {
if (!_.manual) {
_.highlightAll();
}
function highlightAutomaticallyCallback() {
if (!_.manual) {
_.highlightAll();
}
}

if (!_.manual) {
// If the document state is "loading", then we'll use DOMContentLoaded.
// If the document state is "interactive" and the prism.js script is deferred, then we'll also use the
// DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they
Expand Down
2 changes: 1 addition & 1 deletion components/prism-core.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions prism.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,13 +587,13 @@ if (script) {
}
}

if (!_.manual) {
function highlightAutomaticallyCallback() {
if (!_.manual) {
_.highlightAll();
}
function highlightAutomaticallyCallback() {
if (!_.manual) {
_.highlightAll();
}
}

if (!_.manual) {
// If the document state is "loading", then we'll use DOMContentLoaded.
// If the document state is "interactive" and the prism.js script is deferred, then we'll also use the
// DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they
Expand Down

0 comments on commit 984e5d2

Please sign in to comment.