Skip to content

Commit

Permalink
Fix: node.js hacks for components and prism.js
Browse files Browse the repository at this point in the history
  • Loading branch information
valorkin committed Sep 2, 2015
1 parent 2d8271f commit 0fffde4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion prism.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,11 @@ if (typeof module !== 'undefined' && module.exports) {
module.exports = Prism;
}

// hack for components to work correctly in node.js
if (typeof global !== 'undefined') {
global.Prism = Prism;
}


/* **********************************************
Begin prism-markup.js
Expand Down Expand Up @@ -624,7 +629,7 @@ if (Prism.languages.markup) {
********************************************** */

(function () {
if (!self.Prism || !self.document || !document.querySelector) {
if (typeof self === 'undefined' || !self.Prism || !self.document || !document.querySelector) {
return;
}

Expand Down

0 comments on commit 0fffde4

Please sign in to comment.