diff --git a/dist/highlightjs-line-numbers.min.js b/dist/highlightjs-line-numbers.min.js index 9626a5d..3f5abb5 100644 --- a/dist/highlightjs-line-numbers.min.js +++ b/dist/highlightjs-line-numbers.min.js @@ -1 +1 @@ -!function(e){"use strict";function n(n){n=n||i,e.addEventListener("load",function(){try{var e=document.querySelectorAll("code.hljs");for(var r in e)e.hasOwnProperty(r)&&t(e[r],{blockName:"c"+r,withLinks:n.withLinks})}catch(o){console.error("LineNumbers error: ",o)}})}function t(e,n){if("object"==typeof e){n?(n.withLinks=n.withLinks||!1,n.blockName=n.blockName||!1):(n=i,n.blockName="");var t=e.parentNode,l=r(t.textContent);if(l>1){for(var c="",s=0;l>s;s++)c+=n.withLinks?o(s+1,n.blockName):s+1+"\n";var a=document.createElement("code");a.className="hljs hljs-line-numbers",a.style["float"]="left",a.innerHTML=c,t.insertBefore(a,e)}}}function r(e){if(0===e.length)return 0;var n=/\r\n|\r|\n/g,t=e.match(n);return t=t?t.length:0,e[e.length-1].match(n)||(t+=1),t}function o(e,n){var t=n+"_l"+e;return''+e+"\n"}"undefined"==typeof e.hljs?console.error("highlight.js not detected!"):(e.hljs.initLineNumbersOnLoad=n,e.hljs.lineNumbersBlock=t);var i={withLinks:!1}}(window); \ No newline at end of file +!function(e){"use strict";function n(n){n=n||i,e.addEventListener("load",function(){try{var e=document.querySelectorAll("code.hljs");for(var r in e)e.hasOwnProperty(r)&&t(e[r],{blockName:"c"+r,withLinks:n.withLinks})}catch(o){console.error("LineNumbers error: ",o)}})}function t(e,n){if("object"==typeof e){n?(n.withLinks=n.withLinks||!1,n.blockName=n.blockName||!1):(n=i,n.blockName="");var t=e.parentNode,l=r(t.textContent);if(l>1){for(var c="",a=0;l>a;a++)c+=n.withLinks?o(a+1,n.blockName):a+1+"\n";var s=document.createElement("code");s.className="hljs hljs-line-numbers",s.style["float"]="left",s.innerHTML=c,t.insertBefore(s,e)}}}function r(e){if(0===e.length)return 0;var n=/\r\n|\r|\n/g,t=e.match(n);return t=t?t.length:0,e[e.length-1].match(n)||(t+=1),t}function o(e,n){var t=n+"_l"+e;return''+e+"\n"}"undefined"==typeof e.hljs?console.error("highlight.js not detected!"):(e.hljs.initLineNumbersOnLoad=n,e.hljs.lineNumbersBlock=t);var i={withLinks:!1}}(window); \ No newline at end of file diff --git a/src/highlightjs-line-numbers.js b/src/highlightjs-line-numbers.js index ba264bb..8b5bb20 100644 --- a/src/highlightjs-line-numbers.js +++ b/src/highlightjs-line-numbers.js @@ -79,6 +79,6 @@ function getLineWithLink (i, blockName) { var id = blockName + '_l' + i; - return '' + i + '\n' + return '' + i + '\n' } }(window)); \ No newline at end of file