diff --git a/pagure/templates/file.html b/pagure/templates/file.html index 0281dc3..b6e7869 100644 --- a/pagure/templates/file.html +++ b/pagure/templates/file.html @@ -274,9 +274,12 @@ No content found in this repository hljs.lineNumbersBlock(block); var cls = "highlighted-line"; var lines = location.hash.substr(2).split('-').map(function (x) { return parseInt(x, 10) }); - $("#_" + lines[0]).get(0).scrollIntoView(); - for (var i = lines[lines.length - 1]; i >= lines[0]; i--) { - $('#_' + i).parent().parent().addClass(cls); + if (! isNaN(lines[0])) + { + $("#_" + lines[0]).get(0).scrollIntoView(); + for (var i = lines[lines.length - 1]; i >= lines[0]; i--) { + $('#_' + i).parent().parent().addClass(cls); + } } }) }); @@ -313,6 +316,7 @@ No content found in this repository window.location.hash = hash; return false; }); + {% endblock %}