Skip to content

Commit

Permalink
env.code can be modified by before-sanity-check hook even when using…
Browse files Browse the repository at this point in the history
… language-none. Fix #1066
  • Loading branch information
Golmote committed Dec 3, 2016
1 parent 0251471 commit 83bafbd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions components/prism-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ var _ = _self.Prism = {
_.hooks.run('before-sanity-check', env);

if (!env.code || !env.grammar) {
if (env.code) {
env.element.textContent = env.code;
}
_.hooks.run('complete', env);
return;
}
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.

3 changes: 3 additions & 0 deletions prism.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ var _ = _self.Prism = {
_.hooks.run('before-sanity-check', env);

if (!env.code || !env.grammar) {
if (env.code) {
env.element.textContent = env.code;
}
_.hooks.run('complete', env);
return;
}
Expand Down

0 comments on commit 83bafbd

Please sign in to comment.