diff --git a/pagure/static/vendor/highlightjs-line-numbers/INFO b/pagure/static/vendor/highlightjs-line-numbers/INFO index 1eaef34..56b6b91 100644 --- a/pagure/static/vendor/highlightjs-line-numbers/INFO +++ b/pagure/static/vendor/highlightjs-line-numbers/INFO @@ -1,2 +1,8 @@ -This Plugin is from: +This is a slightly patched version of the Highlightjs-line-numbers plugin from +https://github.com/wcoder/highlightjs-line-numbers.js + +It adds some additional classes and links on the line numbers to get some stuff +in Pagure working. + +This was patched over this version of the upstream file: https://github.com/wcoder/highlightjs-line-numbers.js/blob/59f905d3634e09bfd0cb2f4a6efbc3dde1e2f7c5/dist/highlightjs-line-numbers.min.js \ 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 6112cb6..f98c85b 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(n,e){"use strict";function t(){var n=e.createElement("style");n.type="text/css",n.innerHTML=h(".{0}{border-collapse:collapse}.{0} td{padding:0}.{1}:before{content:attr({2})}",[f,m,j]),e.getElementsByTagName("head")[0].appendChild(n)}function r(t){"complete"===e.readyState?l(t):n.addEventListener("DOMContentLoaded",function(){l(t)})}function l(t){try{var r=e.querySelectorAll("code.hljs");for(var l in r)r.hasOwnProperty(l)&&i(r[l],t)}catch(o){n.console.error("LineNumbers error: ",o)}}function i(n,e){if("object"==typeof n){e=e||{singleLine:!1};var t=e.singleLine?0:1;u(function(){s(n),n.innerHTML=o(n.innerHTML,t)})}}function o(n,e){var t=c(n);if(""===t[t.length-1].trim()&&t.pop(),t.length>e){for(var r="",l=0,i=t.length;l
{6}
',[v,g,m,j,p,l+1,t[l].length>0?t[l]:" "]);return h('{1}
',[f,r])}return n}function s(n){var e=n.childNodes;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];d(r.textContent)>0&&(r.childNodes.length>0?s(r):a(r.parentNode))}}function a(n){var e=n.className;if(/hljs-/.test(e)){for(var t=c(n.innerHTML),r=0,l="";r{1}\n',[e,t[r]]);n.innerHTML=l.trim()}}function c(n){return 0===n.length?[]:n.split(L)}function d(n){return(n.trim().match(L)||[]).length}function u(e){n.setTimeout(e,0)}function h(n,e){return n.replace(/\{(\d+)\}/g,function(n,t){return e[t]?e[t]:n})}var f="hljs-ln",g="hljs-ln-line",p="hljs-ln-code",v="hljs-ln-numbers",m="hljs-ln-n",j="data-line-number",L=/\r\n|\r|\n/g;n.hljs?(n.hljs.initLineNumbersOnLoad=r,n.hljs.lineNumbersBlock=i,t()):n.console.error("highlight.js not detected!")}(window,document); \ No newline at end of file +!function(n,e){"use strict";function t(){var n=e.createElement("style");n.type="text/css",n.innerHTML=h(".{0}{border-collapse:collapse}.{0} td{padding:0}.{1}:before{content:attr({2})}",[f,m,j]),e.getElementsByTagName("head")[0].appendChild(n)}function r(t){"complete"===e.readyState?l(t):n.addEventListener("DOMContentLoaded",function(){l(t)})}function l(t){try{var r=e.querySelectorAll("code.hljs");for(var l in r)r.hasOwnProperty(l)&&i(r[l],t)}catch(o){n.console.error("LineNumbers error: ",o)}}function i(n,e){if("object"==typeof n){e=e||{singleLine:!1};var t=e.singleLine?0:1;u(function(){s(n),n.innerHTML=o(n.innerHTML,t)})}}function o(n,e){var t=c(n);if(""===t[t.length-1].trim()&&t.pop(),t.length>e){for(var r="",l=0,i=t.length;l
{6}
',[v,g,m,j,p,l+1,t[l].length>0?t[l]:" "]);return h('{1}
',[f,r])}return n}function s(n){var e=n.childNodes;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];d(r.textContent)>0&&(r.childNodes.length>0?s(r):a(r.parentNode))}}function a(n){var e=n.className;if(/hljs-/.test(e)){for(var t=c(n.innerHTML),r=0,l="";r{1}\n',[e,t[r]]);n.innerHTML=l.trim()}}function c(n){return 0===n.length?[]:n.split(L)}function d(n){return(n.trim().match(L)||[]).length}function u(e){n.setTimeout(e,0)}function h(n,e){return n.replace(/\{(\d+)\}/g,function(n,t){return e[t]?e[t]:n})}var f="hljs-ln",g="hljs-ln-line notblue text-muted",p="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",j="data-line-number",L=/\r\n|\r|\n/g;n.hljs?(n.hljs.initLineNumbersOnLoad=r,n.hljs.lineNumbersBlock=i,t()):n.console.error("highlight.js not detected!")}(window,document); diff --git a/pagure/templates/file.html b/pagure/templates/file.html index 300bc43..7a88740 100644 --- a/pagure/templates/file.html +++ b/pagure/templates/file.html @@ -173,13 +173,7 @@ {% endif %} {% if output_type=='file' %} - {% autoescape false %} - {% if huge %} - {{ content | e | format_loc }} - {% else %} - {{ content | format_loc }} - {% endif %} - {% endautoescape %} +
{{ content }}
{% elif output_type == 'markup' %}
{% autoescape false %} @@ -265,47 +259,49 @@ No content found in this repository {{ super() }} + - + - var hash = '_' + selected[0]; - if (selected.length === 2) { - hash = '_' + Math.min(selected[0], selected[1]) + '-' + Math.max(selected[0], selected[1]); - } - window.location.hash = hash; - return false; -}); - {% endblock %}