Skip to content

Commit

Permalink
Added a default for classMap. Fixes #1137. (#1157)
Browse files Browse the repository at this point in the history
When the classMap is accessed, it is undefined, causing this look up to fail. Defaulting it to an empty object provides the right logic.
https://github.com/PrismJS/prism/blob/16ce4b336d625e13065bfc12ab6d13ac862d6f50/plugins/custom-class/prism-custom-class.js#L25
  • Loading branch information
jimmyhmiller authored and Golmote committed Jul 20, 2017
1 parent 601c47f commit 5400af9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion plugins/custom-class/prism-custom-class.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ if (
return;
}

var options = {};
var options = {
classMap: {}
};
Prism.plugins.customClass = {
map: function map(cm) {
options.classMap = cm;
Expand Down
2 changes: 1 addition & 1 deletion plugins/custom-class/prism-custom-class.min.js

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

0 comments on commit 5400af9

Please sign in to comment.