diff --git a/pagure/static/vendor/highlightjs-line-numbers/INFO b/pagure/static/vendor/highlightjs-line-numbers/INFO index 0c705b5..5828028 100644 --- a/pagure/static/vendor/highlightjs-line-numbers/INFO +++ b/pagure/static/vendor/highlightjs-line-numbers/INFO @@ -4,6 +4,6 @@ https://github.com/wcoder/highlightjs-line-numbers.js Downstream repo: https://pagure.io/pagure-highlightjs-line-numbers.js It adds some additional classes and links on the line numbers to get some stuff -in Pagure working. +in Pagure working and disables inline style tag injection to avoid CSP errors -This file version comes from this commit: https://pagure.io/pagure-highlightjs-line-numbers.js/tree/a8a95ff2384d9f03d8aa832e793ce0af464329ff +This files version comes from this commit: https://pagure.io/pagure-highlightjs-line-numbers.js/c/28702694fea765b90c53690db63b545b2aa0d8b0 diff --git a/pagure/static/vendor/highlightjs-line-numbers/highlightjs-line-numbers.min.css b/pagure/static/vendor/highlightjs-line-numbers/highlightjs-line-numbers.min.css new file mode 100644 index 0000000..7229a7e --- /dev/null +++ b/pagure/static/vendor/highlightjs-line-numbers/highlightjs-line-numbers.min.css @@ -0,0 +1 @@ +.hljs-ln{border-collapse:collapse}.hljs-ln td{padding:0}.hljs-ln-n:before{content:attr(data-line-number)} \ No newline at end of file diff --git a/pagure/static/vendor/highlightjs-line-numbers/highlightjs-line-numbers.min.js b/pagure/static/vendor/highlightjs-line-numbers/highlightjs-line-numbers.min.js index 9c3e9a6..cf5c61f 100644 --- a/pagure/static/vendor/highlightjs-line-numbers/highlightjs-line-numbers.min.js +++ b/pagure/static/vendor/highlightjs-line-numbers/highlightjs-line-numbers.min.js @@ -1 +1 @@ -!function(e,n){"use strict";function t(){var e=n.createElement("style");e.type="text/css",e.innerHTML=u(".{0}{border-collapse:collapse}.{0} td{padding:0}.{1}:before{content:attr({2})}",[f,v,b]),n.getElementsByTagName("head")[0].appendChild(e)}function r(t){"interactive"===n.readyState||"complete"===n.readyState?l(t):e.addEventListener("DOMContentLoaded",function(){l(t)})}function l(t){try{var r=n.querySelectorAll("code.hljs");for(var l in r)r.hasOwnProperty(l)&&i(r[l],t)}catch(o){e.console.error("LineNumbers error: ",o)}}function i(e,n){if("object"==typeof e){n=n||{singleLine:!1};var t=n.singleLine?0:1;h(function(){a(e),e.innerHTML=o(e.innerHTML,t)})}}function o(e,n){var t=c(e);if(""===t[t.length-1].trim()&&t.pop(),t.length>n){for(var r="",l=0,i=t.length;l
{6}
',[m,g,v,b,p,l+1,t[l].length>0?t[l]:" "]);return u('{1}
',[f,r])}return e}function a(e){var n=e.childNodes;for(var t in n)if(n.hasOwnProperty(t)){var r=n[t];d(r.textContent)>0&&(r.childNodes.length>0?a(r):s(r.parentNode))}}function s(e){var n=e.className;if(/hljs-/.test(n)){for(var t=c(e.innerHTML),r=0,l="";r0?t[r]:" ";l+=u('{1}\n',[n,i])}e.innerHTML=l.trim()}}function c(e){return 0===e.length?[]:e.split(j)}function d(e){return(e.trim().match(j)||[]).length}function h(n){e.setTimeout(n,0)}function u(e,n){return e.replace(/\{(\d+)\}/g,function(e,t){return n[t]?n[t]:e})}var f="hljs-ln",g="hljs-ln-line notblue text-muted",p="hljs-ln-code pl-2",m="hljs-ln-numbers bg-light text-right pr-2 pl-2 border-right mr-3",v="hljs-ln-n",b="data-line-number",j=/\r\n|\r|\n/g;e.hljs?(e.hljs.initLineNumbersOnLoad=r,e.hljs.lineNumbersBlock=i,t()):e.console.error("highlight.js not detected!")}(window,document); \ No newline at end of file +!function(n,t){"use strict";function e(e){"interactive"===t.readyState||"complete"===t.readyState?r(e):n.addEventListener("DOMContentLoaded",function(){r(e)})}function r(e){try{var r=t.querySelectorAll("code.hljs");for(var l in r)r.hasOwnProperty(l)&&i(r[l],e)}catch(o){n.console.error("LineNumbers error: ",o)}}function i(n,t){if("object"==typeof n){t=t||{singleLine:!1};var e=t.singleLine?0:1;h(function(){o(n),n.innerHTML=l(n.innerHTML,e)})}}function l(n,t){var e=a(n);if(""===e[e.length-1].trim()&&e.pop(),e.length>t){for(var r="",i=0,l=e.length;i
{6}
',[v,f,m,p,g,i+1,e[i].length>0?e[i]:" "]);return u('{1}
',[d,r])}return n}function o(n){var t=n.childNodes;for(var e in t)if(t.hasOwnProperty(e)){var r=t[e];c(r.textContent)>0&&(r.childNodes.length>0?o(r):s(r.parentNode))}}function s(n){var t=n.className;if(/hljs-/.test(t)){for(var e=a(n.innerHTML),r=0,i="";r0?e[r]:" ";i+=u('{1}\n',[t,l])}n.innerHTML=i.trim()}}function a(n){return 0===n.length?[]:n.split(j)}function c(n){return(n.trim().match(j)||[]).length}function h(t){n.setTimeout(t,0)}function u(n,t){return n.replace(/\{(\d+)\}/g,function(n,e){return t[e]?t[e]:n})}var d="hljs-ln",f="hljs-ln-line notblue text-muted",g="hljs-ln-code pl-2",v="hljs-ln-numbers bg-light text-right pr-2 pl-2 border-right mr-3",m="hljs-ln-n",p="data-line-number",j=/\r\n|\r|\n/g;n.hljs?(n.hljs.initLineNumbersOnLoad=e,n.hljs.lineNumbersBlock=i):n.console.error("highlight.js not detected!")}(window,document); \ No newline at end of file