diff options
Diffstat (limited to 'data/resources/prism')
-rw-r--r-- | data/resources/prism/components/prism-clike.jsin (renamed from data/resources/prism/components/prism-clike.js) | 0 | ||||
-rw-r--r-- | data/resources/prism/components/prism-core.jsin (renamed from data/resources/prism/components/prism-core.js) | 38 | ||||
-rw-r--r-- | data/resources/prism/components/prism-css.jsin (renamed from data/resources/prism/components/prism-css.js) | 0 | ||||
-rw-r--r-- | data/resources/prism/components/prism-javascript.jsin (renamed from data/resources/prism/components/prism-javascript.js) | 0 | ||||
-rw-r--r-- | data/resources/prism/components/prism-markup.jsin (renamed from data/resources/prism/components/prism-markup.js) | 0 | ||||
-rw-r--r-- | data/resources/prism/plugins/data-uri-highlight/prism-data-uri-highlight.jsin (renamed from data/resources/prism/plugins/data-uri-highlight/prism-data-uri-highlight.js) | 0 | ||||
-rw-r--r-- | data/resources/prism/plugins/line-numbers/prism-line-numbers.cssin (renamed from data/resources/prism/plugins/line-numbers/prism-line-numbers.css) | 0 | ||||
-rw-r--r-- | data/resources/prism/plugins/line-numbers/prism-line-numbers.jsin (renamed from data/resources/prism/plugins/line-numbers/prism-line-numbers.js) | 0 | ||||
-rw-r--r-- | data/resources/prism/themes/prism.cssin (renamed from data/resources/prism/themes/prism.css) | 0 |
9 files changed, 22 insertions, 16 deletions
diff --git a/data/resources/prism/components/prism-clike.js b/data/resources/prism/components/prism-clike.jsin index c0b8ff5..c0b8ff5 100644 --- a/data/resources/prism/components/prism-clike.js +++ b/data/resources/prism/components/prism-clike.jsin diff --git a/data/resources/prism/components/prism-core.js b/data/resources/prism/components/prism-core.jsin index f34bcae..408af8d 100644 --- a/data/resources/prism/components/prism-core.js +++ b/data/resources/prism/components/prism-core.jsin @@ -20,6 +20,7 @@ var uniqueId = 0; var _ = _self.Prism = { manual: _self.Prism && _self.Prism.manual, + disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler, util: { encode: function (tokens) { if (tokens instanceof Token) { @@ -184,11 +185,13 @@ var _ = _self.Prism = { // Set language on the element, if not present element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; - // Set language on the parent, for styling - parent = element.parentNode; + if (element.parentNode) { + // Set language on the parent, for styling + parent = element.parentNode; - if (/pre/i.test(parent.nodeName)) { - parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; + if (/pre/i.test(parent.nodeName)) { + parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; + } } var code = element.textContent; @@ -479,18 +482,21 @@ if (!_self.document) { // in Node.js return _self.Prism; } - // In worker - _self.addEventListener('message', function(evt) { - var message = JSON.parse(evt.data), - lang = message.language, - code = message.code, - immediateClose = message.immediateClose; - - _self.postMessage(_.highlight(code, _.languages[lang], lang)); - if (immediateClose) { - _self.close(); - } - }, false); + + if (!_.disableWorkerMessageHandler) { + // In worker + _self.addEventListener('message', function (evt) { + var message = JSON.parse(evt.data), + lang = message.language, + code = message.code, + immediateClose = message.immediateClose; + + _self.postMessage(_.highlight(code, _.languages[lang], lang)); + if (immediateClose) { + _self.close(); + } + }, false); + } return _self.Prism; } diff --git a/data/resources/prism/components/prism-css.js b/data/resources/prism/components/prism-css.jsin index 6a2f7d3..6a2f7d3 100644 --- a/data/resources/prism/components/prism-css.js +++ b/data/resources/prism/components/prism-css.jsin diff --git a/data/resources/prism/components/prism-javascript.js b/data/resources/prism/components/prism-javascript.jsin index a1488ae..a1488ae 100644 --- a/data/resources/prism/components/prism-javascript.js +++ b/data/resources/prism/components/prism-javascript.jsin diff --git a/data/resources/prism/components/prism-markup.js b/data/resources/prism/components/prism-markup.jsin index 1dafd24..1dafd24 100644 --- a/data/resources/prism/components/prism-markup.js +++ b/data/resources/prism/components/prism-markup.jsin diff --git a/data/resources/prism/plugins/data-uri-highlight/prism-data-uri-highlight.js b/data/resources/prism/plugins/data-uri-highlight/prism-data-uri-highlight.jsin index 7ff8d1f..7ff8d1f 100644 --- a/data/resources/prism/plugins/data-uri-highlight/prism-data-uri-highlight.js +++ b/data/resources/prism/plugins/data-uri-highlight/prism-data-uri-highlight.jsin diff --git a/data/resources/prism/plugins/line-numbers/prism-line-numbers.css b/data/resources/prism/plugins/line-numbers/prism-line-numbers.cssin index d5cbfd3..d5cbfd3 100644 --- a/data/resources/prism/plugins/line-numbers/prism-line-numbers.css +++ b/data/resources/prism/plugins/line-numbers/prism-line-numbers.cssin diff --git a/data/resources/prism/plugins/line-numbers/prism-line-numbers.js b/data/resources/prism/plugins/line-numbers/prism-line-numbers.jsin index dea8e3a..dea8e3a 100644 --- a/data/resources/prism/plugins/line-numbers/prism-line-numbers.js +++ b/data/resources/prism/plugins/line-numbers/prism-line-numbers.jsin diff --git a/data/resources/prism/themes/prism.css b/data/resources/prism/themes/prism.cssin index 83ef295..83ef295 100644 --- a/data/resources/prism/themes/prism.css +++ b/data/resources/prism/themes/prism.cssin |