diff --git a/dist/rainbow.js b/dist/rainbow.js index 6eab6064..483fad55 100644 --- a/dist/rainbow.js +++ b/dist/rainbow.js @@ -630,7 +630,7 @@ * Counter for block ids * @see https://github.com/ccampbell/rainbow/issues/207 */ - var id = 0; + var id = 0; var isNode = isNode$1(); var isWorker = isWorker$1(); @@ -679,9 +679,11 @@ return function _handleResponseFromWorker(data) { element.innerHTML = data.result; element.classList.remove('loading'); + element.classList.add('rainbow-show'); if (element.parentNode.tagName === 'PRE') { element.parentNode.classList.remove('loading'); + element.parentNode.classList.add('rainbow-show'); } // element.addEventListener('animationend', (e) => { @@ -1025,4 +1027,4 @@ return Rainbow$1; })); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjpudWxsLCJzb3VyY2VzIjpbIi4uL3NyYy91dGlsLmpzIiwiLi4vc3JjL3ByaXNtLmpzIiwiLi4vc3JjL3dvcmtlci5qcyIsIi4uL3NyYy9yYWluYm93LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIlxuZXhwb3J0IGZ1bmN0aW9uIGlzTm9kZSgpIHtcbiAgICAvKiBnbG9iYWxzIG1vZHVsZSAqL1xuICAgIHJldHVybiB0eXBlb2YgbW9kdWxlICE9PSAndW5kZWZpbmVkJyAmJiB0eXBlb2YgbW9kdWxlLmV4cG9ydHMgPT09ICdvYmplY3QnO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gaXNXb3JrZXIoKSB7XG4gICAgcmV0dXJuIHR5cGVvZiBkb2N1bWVudCA9PT0gJ3VuZGVmaW5lZCcgJiYgdHlwZW9mIHNlbGYgIT09ICd1bmRlZmluZWQnO1xufVxuXG4vKipcbiAqIEJyb3dzZXIgT25seSAtIEdldHMgdGhlIGxhbmd1YWdlIGZvciB0aGlzIGJsb2NrIG9mIGNvZGVcbiAqXG4gKiBAcGFyYW0ge0VsZW1lbnR9IGJsb2NrXG4gKiBAcmV0dXJuIHtzdHJpbmd8bnVsbH1cbiAqL1xuZ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Y3RVUkwoYmxvYikpO1xufVxuIiwiaW1wb3J0IHsgcmVwbGFjZUF0UG9zaXRpb24sIGluZGV4T2ZHcm91cCwga2V5cywgaHRtbEVudGl0aWVzLCBoYXNDb21wbGV0ZU92ZXJsYXAsIGludGVyc2VjdHMgfSBmcm9tICcuL3V0aWwnO1xuXG4vKipcbiAqIFByaXNtIGlzIGEgY2xhc3MgdXNlZCB0byBoaWdobGlnaHQgaW5kaXZpZHVhbCBibG9ja3Mgb2YgY29kZVxuICpcbiAqIEBjbGFzc1xuICovXG5jbGFzcyBQcmlzbSB7XG4gICAgY29uc3RydWN0b3Iob3B0aW9ucykge1xuICAgICAgICAvKipcbiAgICAgICAgICogT2JqZWN0IG9mIHJlcGxhY2VtZW50cyB0byBwcm9jZXNzIGF0IHRoZSBlbmQgb2YgdGhlIHByb2Nlc3NpbmdcbiAgICAgICAgICpcbiAgICAgICAgICogQHR5cGUge09iamVjdH1cbiAgICAgICAgICovXG4gICAgICAgIGNvbnN0IHJlcGxhY2VtZW50cyA9IHt9O1xuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBMYW5ndWFnZSBhc3NvY2lhdGVkIHdpdGggdGhpcyBQcmlzbSBvYmplY3RcbiAgICAgICAgICpcbiAgICAgICAgICogQHR5cGUge3N0cmluZ31cbiAgICAgICAgICovXG4gICAgICAgIGxldCBjdXJyZW50TGFuZ3VhZ2U7XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIE9iamVjdCBvZiBzdGFydCBhbmQgZW5kIHBvc2l0aW9ucyBvZiBibG9ja3MgdG8gYmUgcmVwbGFjZWRcbiAgICAgICAgICpcbiAgICAgICAgICogQHR5cGUge09iamVjdH1cbiAgICAgICAgICovXG4gICAgICAgIGNvbnN0IHJlcGxhY2VtZW50UG9zaXRpb25zID0ge307XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIERldGVybWluZXMgaWYgdGhlIG1hdGNoIHBhc3NlZCBpbiBmYWxscyBpbnNpZGUgb2YgYW4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WVudFBvc2l0aW9uc1trZXldLCBzdGFydCwgZW5kKSkge1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgcmVwbGFjZW1lbnRQb3NpdGlvbnNba2V5XTtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHJlcGxhY2VtZW50c1trZXldO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChpbnRlcnNlY3RzKGtleSwgcmVwbGFjZW1lbnRQb3NpdGlvbnNba2V5XSwgc3RhcnQsIGVuZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICAvKipcbiAgICAgICAgICogVGFrZXMgYSBzdHJpbmcgb2YgY29kZSBhbmQgd3JhcHMgaXQgaW4gYSBzcGFuIHRhZyBiYXNlZCBvbiB0aGUgbmFtZVxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbmFtZSAgICAgICAgbmFtZSBvZiB0aGUgcGF0dGVybiAoaWUga2V5d29yZC5yZWdleClcbiAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGNvZGUgICAgICAgIGJsb2NrIG9mIGNvZGUgdG8gd3JhcFxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gZ2xvYmFsQ2xhc3MgY2xhc3MgdG8gYXBwbHkgdG8gZXZlcnkgc3BhblxuICAgICAgICAgKiBAcmV0dXJuIHtzdHJpbmd9XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiBfd3JhcENvZGVJblNwYW4obmFtZSwgY29kZSkge1xuICAgICAgICAgICAgbGV0IGNsYXNzTmFtZSA9IG5hbWUucmVwbGFjZSgvXFwuL2csICcgJyk7XG5cbiAgICAgICAgICAgIGNvbnN0IGdsb2JhbENsYXNzID0gb3B0aW9ucy5nbG9iYWxDbGFzcztcbiAgICAgICAgICAgIGlmIChnbG9iYWxDbGFzcykge1xuICAgICAgICAgICAgICAgIGNsYXNzTmFtZSArPSBgICR7Z2xvYmFsQ2xhc3N9YDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIGA8c3BhbiBjbGFzcz1cIiR7Y2xhc3NOYW1lfVwiPiR7Y29kZX08L3NwYW4+YDtcbiAgICAgICAgfVxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBQcm9jZXNzIHJlcGxhY2VtZW50cyBpbiB0aGUgc3RyaW5nIG9mIGNvZGUgdG8gYWN0dWFsbHkgdXBkYXRlXG4gICAgICAgICAqIHRoZSBtYXJrdXBcbiAgICAgICAgICpcbiAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGNvZGUgICAgICAgICB0aGUgY29kZSB0byBwcm9jZXNzIHJlcGxhY2VtZW50cyBpblxuICAgICAgICAgKiBAcmV0dXJuIHtzdHJpbmd9XG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiBfcHJvY2Vzc1JlcGxhY2VtZW50cyhjb2RlKSB7XG4gICAgICAgICAgICBjb25zdCBwb3NpdGlvbnMgPSBrZXlzKHJlcGxhY2VtZW50cyk7XG4gICAgICAgICAgICBmb3IgKGNvbnN0IHBvc2l0aW9uIG9mIHBvc2l0aW9ucykge1xuICAgICAgICAgICAgICAgIGNvbnN0IHJlcGxhY2VtZW50ID0gcmVwbGFjZW1lbnRzW3Bvc2l0aW9uXTtcbiAgICAgICAgICAgICAgICBjb2RlID0gcmVwbGFjZUF0UG9zaXRpb24ocG9zaXRpb24sIHJlcGxhY2VtZW50LnJlcGxhY2UsIHJlcGxhY2VtZW50LndpdGgsIGNvZGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGNvZGU7XG4gICAgICAgIH1cblxuICAgICAgICAvKipcbiAgICAgICAgICogSXQgaXMgc28gd2UgY2FuIGNyZWF0ZSBhIG5ldyByZWdleCBvYmplY3QgZm9yIGVhY2ggY2FsbCB0b1xuICAgICAgICAgKiBfcHJvY2Vzc1BhdHRlcm4gdG8gYXZvaWQgc3RhdGUgY2Fycnlpbmcgb3ZlciB3aGVuIHJ1bm5pbmcgZXhlY1xuICAgICAgICAgKiBtdWx0aXBsZSB0aW1lcy5cbiAgICAgICAgICpcbiAgICAgICAgICogVGhlIGdsb2JhbCBmbGFnIHNob3VsZCBub3QgYmUgY2FycmllZCBvdmVyIGJlY2F1c2Ugd2UgYXJlIHNpbXVsYXRpbmdcbiAgICAgICAgICogaXQgYnkgcHJvY2Vzc2luZyB0aGUgcmVnZXggaW4gYSBsb29wIHNvIHdlIG9ubHkgY2FyZSBhYm91dCB0aGUgZmlyc3RcbiAgICAgICAgICogbWF0Y2ggaW4gZWFjaCBzdHJpbmcuIFRoaXMgYWxzbyBzZWVtcyB0byBpbXByb3ZlIHBlcmZvcm1hbmNlIHF1aXRlIGFcbiAgICAgICAgICogYml0LlxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0ge1JlZ0V4cH0gcmVnZXhcbiAgICAgICAgICogQHJldHVybiB7c3RyaW5nfVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gX2Nsb25lUmVnZXgocmVnZXgpIHtcbiAgICAgICAgICAgIGxldCBmbGFncyA9ICcnO1xuXG4gICAgICAgICAgICBpZiAocmVnZXguaWdub3JlQ2FzZSkge1xuICAgICAgICAgICAgICAgIGZsYWdzICs9ICdpJztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHJlZ2V4Lm11bHRpbGluZSkge1xuICAgICAgICAgICAgICAgIGZsYWdzICs9ICdtJztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIG5ldyBSZWdFeHAocmVnZXguc291cmNlLCBmbGFncyk7XG4gICAgICAgIH1cblxuICAgICAgICAvKipcbiAgICAgICAgICogTWF0Y2hlcyBhIHJlZ2V4IHBhdHRlcm4gYWdhaW5z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dGhlcndpc2UgdGhpcyBjYW4gbGVhZCB0byBhbiBpbmZpbml0ZSBsb29wLlxuICAgICAgICAgICAgaWYgKHN0YXJ0UG9zID09PSBlbmRQb3MpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIElmIHRoaXMgaXMgbm90IGEgY2hpbGQgbWF0Y2ggYW5kIGl0IGZhbGxzIGluc2lkZSBvZiBhbm90aGVyXG4gICAgICAgICAgICAvLyBtYXRjaCB0aGF0IGFscmVhZHkgaGFwcGVuZWQgd2Ugc2hvdWxkIHNraXAgaXQgYW5kIGNvbnRpbnVlXG4gICAgICAgICAgICAvLyBwcm9jZXNzaW5nLlxuICAgICAgICAgICAgaWYgKF9tYXRjaElzSW5zaWRlT3RoZXJNYXRjaChzdGFydFBvcywgZW5kUG9zKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgIHJlbWFpbmluZzogY29kZS5zdWJzdHIoZW5kUG9zIC0gb2Zmc2V0KSxcbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0OiBlbmRQb3NcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIENhbGxiYWNrIGZvciB3aGVuIGEgbWF0Y2ggd2FzIHN1Y2Nlc3NmdWxseSBwcm9jZXNzZWRcbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gcmVwbFxuICAgICAgICAgICAgICogQHJldHVybiB7dm9pZH1cbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgZnVuY3Rpb24gb25NYXRjaFN1Y2Nlc3MocmVwbCkge1xuXG4gICAgICAgICAgICAgICAgLy8gSWYgdGhpcyBtYXRjaCBoYXMgYSBuYW1lIHRoZW4gd3JhcCBpdCBpbiBhIHNwYW4gdGFnXG4gICAgICAgICAgICAgICAgaWYgKHBhdHRlcm4ubmFtZSkge1xuICAgICAgICAgICAgICAgICAgICByZXBsID0gX3dyYXBDb2RlSW5TcGFuKHBhdHRlcm4ubmFtZSwgcmVwbCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gRm9yIGRlYnVnZ2luZ1xuICAgICAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKCdSZXBsYWNlICcgKyBtYXRjaFswXSArICcgd2l0aCAnICsgcmVwbGFjZW1lbnQgKyAnIGF0IHBvc2l0aW9uICcgKyBzdGFydFBvcyArICcgdG8gJyArIGVuZFBvcyk7XG5cbiAgICAgICAgICAgICAgICAvLyBTdG9yZSB3aGF0IG5lZWRzIHRvIGJlIHJlcGxhY2VkIHdpdGggd2hhdCBhdCB0aGlzIHBvc2l0aW9uXG4gICAgICAgICAgICAgICAgcmVwbGFjZW1lbnRzW3N0YXJ0UG9zXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ3JlcGxhY2UnOiBtYXRjaFswXSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGgnOiByZXBsXG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIC8vIFN0b3JlIHRoZSByYW5nZSBvZiB0aGlzIG1hdGNoIHNvIHdlIGNhbiB1c2UgaXQgZm9yXG4gICAgICAgICAgICAgICAgLy8gY29tcGFyaXNvbnMgd2l0aCBvdGhlciBtYXRjaGVzIGxhdGVyLlxuICAgICAgICAgICAgICAgIHJlcGxhY2VtZW50UG9zaXRpb25zW3N0YXJ0UG9zXSA9IGVuZFBvcztcblxuICAgICAgICAgICAgICAgIGlmIChzaG91bGRTdG9wKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICByZW1haW5pbmc6IGNvZGUuc3Vic3RyKGVuZFBvcyAtIG9mZnNldCksXG4gICAgICAgICAgICAgICAgICAgIG9mZnNldDogZW5kUG9zXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBIZWxwZXIgZnVuY3Rpb24gZm9yIHByb2Nlc3NpbmcgYSBzdWIgZ3JvdXBcbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gZ3JvdXBLZXkgICAgICBpbmRleCBvZiBncm91cFxuICAgICAgICAgICAgICogQHJldHVybiB7dm9pZH1cbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgZnVuY3Rpb24gX3Byb2Nlc3NHcm91cChncm91cEtleSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IGJsb2NrID0gbWF0Y2hbZ3JvdXBLZXldO1xuXG4gICAgICAgICAgICAgICAgLy8gSWYgdGhlcmUgaXMgbm8gbWF0Y2ggaGVyZSB0aGVuIG1vdmUgb25cbiAgICAgICAgICAgICAgICBpZiAoIWJsb2NrKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjb25zdCBncm91cCA9IHBhdHRlcm4ubWF0Y2hlc1tncm91cEtleV07XG4gICAgICAgICAgICAgICAgY29uc3QgbGFuZ3VhZ2UgPSBncm91cC5sYW5ndWFnZTtcblxuICAgICAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICAgICAqIFByb2Nlc3MgZ3JvdXAgaXMgd2hhdCBncm91cCB3ZSBzaG91bGQgdXNlIHRvIGFjdHVhbGx5IHByb2Nlc3NcbiAgICAgICAgICAgICAgICAgKiB0aGlzIG1hdGNoIGdyb3VwLlxuICAgICAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgICAgICogRm9yIGV4YW1wbGUgaWYgdGhlIHN1Ymdyb3VwIHBhdHRlcm4gbG9va3MgbGlrZSB0aGlzOlxuICAgICAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgICAgICogMjoge1xuICAgICAgICAgICAgICAgICAqICAgICAnbmFtZSc6ICdrZXl3b3JkJyxcbiAgICAgICAgICAgICAgICAgKiAgICAgJ3BhdHRlcm4nOiAvdHJ1ZS9nXG4gICAgICAgICAgICAgICAgICogfVxuICAgICAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgICAgICogdGhlbiB3ZSB1c2UgdGhhdCBhcyBpcywgYnV0IGlmIGl0IGxvb2tzIGxpa2UgdGhpczpcbiAgICAgICAgICAgICAgICAgKlxuICAgICAgICAgICAgICAgICAqIDI6IHtcbiAgICAgICAgICAgICAgICAgKiAgICAgJ25hbWUnOiAna2V5d29yZCcsXG4gICAgICAgICAgICAgICAgICogICAgICdtYXRjaGVzJzoge1xuICAgICAgICAgICAgICAgICAqICAgICAgICAgICduYW1lJzogJ3NwZWNpYWwnLFxuICAgICAgICAgICAgICAgICAqICAgICAgICAgICdwYXR0ZXJuJzogL3doYXRldmVyL2dcbiAgICAgICAgICAgICAgICAgKiAgICAgIH1cbiAgICAgICAgICAgICAgICAgKiB9XG4gICAgICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAgICAgKiB3ZSB0cmVhdCB0aGUgJ21hdGNoZXMnIHBhcnQgYXMgdGhlIHBhdHRlcm4gYW5kIGtlZXBcbiAgICAgICAgICAgICAgICAgKiB0aGUgbmFtZSBhcm91bmQgdG8gd3JhcCBpdCB3aXRoIGxhdGVyXG4gICAgICAgICAgICAgICAgICovXG4gICAgICAgICAgICAgICAgY29uc3QgZ3JvdXBUb1Byb2Nlc3MgPSBncm91cC5uYW1lICYmIGdyb3VwLm1hdGNoZXMgPyBncm91cC5tYXRjaGVzIDogZ3JvdXA7XG5cbiAgICAgICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAgICAgKiBUYWtlcyB0aGUgY29kZSBibG9jayBtYXRjaGVkIGF0IHRoaXMgZ3JvdXAsIHJlcGxhY2VzIGl0XG4gICAgICAgICAgICAgICA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XJ0LCBlbmQpIHtcbiAgICAgICAgICAgIGZvciAobGV0IGtleSBpbiByZXBsYWNlbWVudFBvc2l0aW9ucykge1xuICAgICAgICAgICAgICAgIGtleSA9IHBhcnNlSW50KGtleSwgMTApO1xuXG4gICAgICAgICAgICAgICAgLy8gSWYgdGhpcyBibG9jayBjb21wbGV0ZWx5IG92ZXJsYXBzIHdpdGggYW5vdGhlciBibG9ja1xuICAgICAgICAgICAgICAgIC8vIHRoZW4gd2Ugc2hvdWxkIHJlbW92ZSB0aGUgb3RoZXIgYmxvY2sgYW5kIHJldHVybiBgZmFsc2VgLlxuICAgICAgICAgICAgICAgIGlmIChoYXNDb21wbGV0ZU92ZXJsYXAoa2V5LCByZXBsYWNlbWVudFBvc2l0aW9uc1trZXldLCBzdGFydCwgZW5kKSkge1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgcmVwbGFjZW1lbnRQb3NpdGlvbnNba2V5XTtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHJlcGxhY2VtZW50c1trZXldO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChpbnRlcnNlY3RzKGtleSwgcmVwbGFjZW1lbnRQb3NpdGlvbnNba2V5XSwgc3RhcnQsIGVuZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICAvKipcbiAgICAgICAgICogVGFrZXMgYSBzdHJpbmcgb2YgY29kZSBhbmQgd3JhcHMgaXQgaW4gYSBzcGFuIHRhZyBiYXNlZCBvbiB0aGUgbmFtZVxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbmFtZSAgICAgICAgbmFtZSBvZiB0aGUgcGF0dGVybiAoaWUga2V5d29yZC5yZWdleClcbiAgICAgICAgICogQHBhcmFtIHtzdH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IHtcbiAgICAgICAgICAgIGxldCBmbGFncyA9ICcnO1xuXG4gICAgICAgICAgICBpZiAocmVnZXguaWdub3JlQ2FzZSkge1xuICAgICAgICAgICAgICAgIGZsYWdzICs9ICdpJztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHJlZ2V4Lm11bHRpbGluZSkge1xuICAgICAgICAgICAgICAgIGZsYWdzICs9ICdtJztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIG5ldyBSZWdFeHAocmVnZXguc291cmNlLCBmbGFncyk7XG4gICAgICAgIH1cblxuICAgICAgICAvKipcbiAgICAgICAgICogTWF0Y2hlcyBhIHJlZ2V4IHBhdHRlcm4gYWdhaW5zdCBhIGJsb2NrIG9mIGNvZGUsIGZpbmRzIGFsbCBtYXRjaGVzXG4gICAgICAgICAqIHRoYXQgc2hvdWxkIGJlIHByb2Nlc3NlZCwgYW5kIHN0b3JlcyB0aGUgcG9zaXRpb25zIG9mIHdoZXJlIHRoZXlcbiAgICAgICAgICogc2hvdWxkIGJlIHJlcGxhY2VkIHdpdGhpbiB0aGUgc3RyaW5nLlxuICAgICAgICAgKlxuICAgICAgICAgKiBUaGlzIGlzIHdoZXJlIHByZXR0eSBtdWNoIGFsbCB0aGUgd29yayBpcyBkb25lIGJ1dCBpdCBzaG91bGQgbm90XG4gICAgICAgICAqIGJlIGNhbGxlZCBkaXJlY3RseS5cbiAgICAgICAgICpcbiAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IHBhdHRlcm5cbiAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGNvZGVcbiAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IG9mZnNldFxuICAgICAgICAgKiBAcmV0dXJuIHttaXhlZH1cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIF9wcm9jZXNzUGF0dGVybihwYXR0ZXJuLCBjb2RlLCBvZmZzZXQgPSAwKSB7XG4gICAgICAgICAgICBsZXQgcmVnZXgg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AgICAgICAvKipcbiAgICAgICAgICAgICAqIENhbGxiYWNrIGZvciB3aGVuIGEgbWF0Y2ggd2FzIHN1Y2Nlc3NmdWxseSBwcm9jZXNzZWRcbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gcmVwbFxuICAgICAgICAgICAgICogQHJldHVybiB7dm9pZH1cbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgZnVuY3Rpb24gb25NYXRjaFN1Y2Nlc3MocmVwbCkge1xuXG4gICAgICAgICAgICAgICAgLy8gSWYgdGhpcyBtYXRjaCBoYXMgYSBuYW1lIHRoZW4gd3JhcCBpdCBpbiBhIHNwYW4gdGFnXG4gICAgICAgICAgICAgICAgaWYgKHBhdHRlcm4ubmFtZSkge1xuICAgICAgICAgICAgICAgICAgICByZXBsID0gX3dyYXBDb2RlSW5TcGFuKHBhdHRlcm4ubmFtZSwgcmVwbCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gRm9yIGRlYnVnZ2luZ1xuICAgICAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKCdSZXBsYWNlICcgKyBtYXRjaFswXSArICcgd2l0aCAnICsgcmVwbGFjZW1lbnQgKyAnIGF0IHBvc2l0aW9uICcgKyBzdGFydFBvcyArICcgdG8gJyArIGVuZFBvcyk7XG5cbiAgICAgICAgICAgICAgICAvLyBTdG9yZSB3aGF0IG5lZWRzIHRvIGJlIHJlcGxhY2VkIHdpdGggd2hhdCBhdCB0aGlzIHBvc2l0aW9uXG4gICAgICAgICAgICAgICAgcmVwbGFjZW1lbnRzW3N0YXJ0UG9zXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ3JlcGxhY2UnOiBtYXRjaFswXSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGgnOiByZXBsXG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIC8vIFN0b3JlIHRoZSByYW5nZSBvZiB0aGlzIG1hdGNoIHNvIHdlIGNhbiB1c2UgaXQgZm9yXG4gICAgICAgICAgICAgICAgLy8gY29tcGFyaXNvbnMgd2l0aCBvdGhlciBtYXRjaGVzIGxhdGVyLlxuICAgICAgICAgICAgICAgIHJlcGxhY2VtZW50UG9zaXRpb25zW3N0YXJ0UG9zXSA9IGVuZFBvcztcblxuICAgICAgICAgICAgICAgIGlmIChzaG91bGRTdG9wKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICByZW1haW5pbmc6IGNvZGUuc3Vic3RyKGVuZFBvcyAtIG9mZnNldCksXG4gICAgICAgICAgICAgICAgICAgIG9mZnNldDogZW5kUG9zXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBIZWxwZXIgZnVuY3Rpb24gZm9yIHByb2Nlc3NpbmcgYSBzdWIgZ3JvdXBcbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gZ3JvdXBLZXkgICAgICBpbmRleCBvZiBncm91cFxuICAgICAgICAgICAgICogQHJldHVybiB7dm9pZH1cbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgZnVuY3Rpb24gX3Byb2Nlc3NHcm91cChncm91cEtleSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IGJsb2NrID0gbWF0Y2hbZ3JvdXBLZXldO1xuXG4gICAgICAgICAgICAgICAgLy8gSWYgdGhlcmUgaXMgbm8gbWF0Y2ggaGVyZSB0aGVuIG1vdmUgb25cbiAgICAgICAgICAgICAgICBpZiAoIWJsb2NrKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjb25zdCBncm91cCA9IHBhdHRlcm4ubWF0Y2hlc1tncm91cEtleV07XG4gICAgICAgICAgICAgICAgY29uc3QgbGFuZ3VhZ2UgPSBncm91cC5sYW5ndWFnZTtcblxuICAgICAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICAgICAqIFByb2Nlc3MgZ3JvdXAgaXMgd2hhdCBncm91cCB3ZSBzaG91bGQgdXNlIHRvIGFjdHVhbGx5IHByb2Nlc3NcbiAgICAgICAgICAgICAgICAgKiB0aGlzIG1hdGNoIGdyb3VwLlxuICAgICAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgICAgICogRm9yIGV4YW1wbGUgaWYgdGhlIHN1Ymdyb3VwIHBhdHRlcm4gbG9va3MgbGlrZSB0aGlzOlxuICAgICAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgICAgICogMjoge1xuICAgICAgICAgICAgICAgICAqICAgICAnbmFtZSc6ICdrZXl3b3JkJyxcbiAgICAgICAgICAgICAgICAgKiAgICAgJ3BhdHRlcm4nOiAvdHJ1ZS9nXG4gICAgICAgICAgICAgICAgICogfVxuICAgICAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgICAgICogdGhlbiB3ZSB1c2UgdGhhdCBhcyBpcywgYnV0IGlmIGl0IGxvb2tzIGxpa2UgdGhpczpcbiAgICAgICAgICAgICAgICAgKlxuICAgICAgICAgICAgICAgICAqIDI6IHtcbiAgICAgICAgICAgICAgICAgKiAgICAgJ25hbWUnOiAna2V5d29yZCcsXG4gICAgICAgICAgICAgICAgICogICAgICdtYXRjaGVzJzoge1xuICAgICAgICAgICAgICAgICAqICAgICAgICAgICduYW1lJzogJ3NwZWNpYWwnLFxuICAgICAgICAgICAgICAgICAqICAgICAgICAgICdwYXR0ZXJuJzogL3doYXRldmVyL2dcbiAgICAgICAgICAgICAgICAgKiAgICAgIH1cbiAgICAgICAgICAgICAgICAgKiB9XG4gICAgICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAgICAgKiB3ZSB0cmVhdCB0aGUgJ21hdGNoZXMnIHBhcnQg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gOiByZXBsYWNlQmxvY2ssIHJlcGxhY2VtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICAvLyBJZiB0aGlzIGlzIGEgc3RyaW5nIHRoZW4gdGhpcyBtYXRjaCBpcyBkaXJlY3RseSBtYXBwZWRcbiAgICAgICAgICAgICAgICAvLyB0byBzZWxlY3RvciBzbyBhbGwgd2UgaGF2ZSB0byBkbyBpcyB3cmFwIGl0IGluIGEgc3BhblxuICAgICAgICAgICAgICAgIC8vIGFuZCBjb250aW51ZS5cbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGdyb3VwID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICBfZ2V0UmVwbGFjZW1lbnQoYmxvY2ssIGJsb2NrLCBncm91cCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBsZXQgbG9jYWxDb2RlO1xuICAgICAgICAgICAgICAgIGNvbnN0IHByaXNtID0gbmV3IFByaXNtKG9wdGlvbnMpO1xuXG4gICAgICAgICAgICAgICAgLy8gSWYgdGhpcyBpcyBhIHN1Ymxhbmd1YWdlIGdvIGFuZCBwcm9jZXNzIHRoZSBibG9jayB1c2luZ1xuICAgICAgICAgICAgICAgIC8vIHRoYXQgbGFuZ3VhZ2VcbiAgICAgICAgICAgICAgICBpZiAobGFuZ3VhZ2UpIHtcbiAgICAgICAgICAgICAgICAgICAgbG9jYWxDb2RlID0gcHJpc20ucmVmcmFjdChibG9jaywgbGFuZ3VhZ2UpO1xuICAgICAgICAgICAgICAgICAgICBfZ2V0UmVwbGFjZW1lbnQoYmxvY2ssIGxvY2FsQ29kZSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBUaGUgcHJvY2VzcyBncm91cCBjYW4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H1cblxuICAgICAgICAvLyBlbGVtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ2FuaW1hdGlvbmVuZCcsIChlKSA9PiB7XG4gICAgICAgIC8vICAgICBpZiAoZS5hbmltYXRpb25OYW1lID09PSAnZmFkZS1pbicpIHtcbiAgICAgICAgLy8gICAgICAgICBzZXRUaW1lb3V0KCgpID0+IHtcbiAgICAgICAgLy8gICAgICAgICAgICAgZWxlbWVudC5jbGFzc0xpc3QucmVtb3ZlKCdkZWNyZWFzZS1kZWxheScpO1xuICAgICAgICAvLyAgICAgICAgIH0sIDEwMDApO1xuICAgICAgICAvLyAgICAgfVxuICAgICAgICAvLyB9KTtcblxuICAgICAgICBpZiAob25IaWdobGlnaHRDYWxsYmFjaykge1xuICAgICAgICAgICAgb25IaWdobGlnaHRDYWxsYmFjayhlbGVtZW50LCBkYXRhLmxhbmcpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKC0td2FpdGluZ09uLmMgPT09IDApIHtcbiAgICAgICAgICAgIGNhbGxiYWNrKCk7XG4gICAgICAgIH1cbiAgICB9O1xufVxuXG4vKipcbiAqIEdldHMgb3B0aW9ucyBuZWVkZWQgdG8gcGFzcyBpbnRvIFByaXNtXG4gKlxuICogQHBhcmFtIHtvYmplY3R9IG9wdGlvbnNcbiAqIEByZXR1cm4ge29iamVjdH1cbiAqL1xuZnVuY3Rpb24gX2dldFByaXNtT3B0aW9ucyhvcHRpb25zKSB7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgcGF0dGVybnMsXG4gICAgICAgIGluaGVyaXRlbmNlTWFwLFxuICAgICAgICBhbGlhc2VzLFxuICAgICAgICBnbG9iYWxDbGFzczogb3B0aW9ucy5nbG9iYWxDbGFzcyxcbiAgICAgICAgZGVsYXk6ICFpc05hTihvcHRpb25zLmRlbGF5KSA/IG9wdGlvbnMuZGVsYXkgOiAwXG4gICAgfTtcbn1cblxuLyoqXG4gKiBHZXRzIGRhdGEgdG8gc2VuZCB0byB3ZWJ3b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UsVUFBQyxLQUFLLEVBQUU7WUFDbEQsSUFBSSxDQUFDLE9BQU8sQ0FBQyxLQUFLLEVBQUU7Z0JBQ2hCLE9BQU8sQ0FBQyxLQUFLLENBQUMsS0FBSyxDQUFDLENBQUM7YUFDeEI7U0FDSixFQUFFLEtBQUssQ0FBQyxDQUFDO0tBQ2I7OztBQUdELElBQUEsSUFBSSxRQUFRLEVBQUU7UUFDVixJQUFJLENBQUMsU0FBUyxHQUFHLGFBQWEsQ0FBQztLQUNsQzs7QUFFRCxvQkFBZSxPQUFPLENBQUM7Ozs7In0= \ No newline at end of file diff --git a/dist/rainbow.min.js b/dist/rainbow.min.js index bf9a1d82..42a53ded 100644 --- a/dist/rainbow.min.js +++ b/dist/rainbow.min.js @@ -1,2 +1,2 @@ -/* Rainbow v2.1.3 rainbowco.de | included languages: c, csharp, css, generic, html, java, javascript, json, php, python, ruby */!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Rainbow=t()}(this,function(){"use strict";function e(){return"undefined"!=typeof module&&"object"==typeof module.exports}function t(e){var t=e.getAttribute("data-language")||e.parentNode.getAttribute("data-language");if(!t){var n=e.className.match(/\blang(?:uage)?-(\w+)/)||e.parentNode.className.match(/\blang(?:uage)?-(\w+)/);n&&(t=n[1])}return t?t.toLowerCase():null}function n(e,t,n,r){return(n!==e||r!==t)&&(n<=e&&r>=t)}function r(e){return e.replace(//g,">").replace(/&(?![\w\#]+;)/g,"&")}function a(e,t){for(var n=0,r=1;r=e&&ne&&r'+n+""}function c(e){for(var t=i(v),n=0,r=t;n=t)}function r(e){return e.replace(//g,">").replace(/&(?![\w\#]+;)/g,"&")}function a(e,t){for(var n=0,r=1;r=e&&ne&&r'+n+""}function c(e){for(var t=i(v),n=0,r=t;n