Sha256: fe5774e4d8b81be61a8e088f81badc0162068a4c32865e4ad633b8c87e7f19b1
Contents?: true
Size: 946 Bytes
Versions: 21
Compression:
Stored size: 946 Bytes
Contents
(function(){ if (!window.Prism) { return; } var dummy = document.createElement('header'); if (!String.prototype.trim) { String.prototype.trim = function () { return this.replace(/^\s+/g, '').replace(/\s+$/g, ''); }; } // textContent polyfill if (!('textContent' in dummy) && ('innerText' in dummy) && Object.defineProperty) { Object.defineProperty(Element.prototype, 'textContent', { get: function() { return this.innerText; }, set: function(text) { this.innerText = text; } }); } // IE8 doesn't have DOMContentLoaded if (!document.addEventListener && 'textContent' in dummy) { setTimeout(Prism.highlightAll, 10); } // Test if innerHTML line break bug is present dummy.innerHTML = '\r\n'; if (dummy.textContent.indexOf('\n') === -1) { // IE8 innerHTML bug: Discards line breaks Prism.hooks.add('after-highlight', function(env) { env.element.innerHTML = env.highlightedCode.replace(/\r?\n/g, '<br>'); }); } })();
Version data entries
21 entries across 21 versions & 4 rubygems