Skip to content

Commit 244d3e4

Browse files
committed
only link line numbers on source page
1 parent 3ec0001 commit 244d3e4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

root/static/js/syntaxhighlighter.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,17 @@ $(function () {
147147
).join(', ');
148148
pre.find('.syntaxhighlighter .line').filter(selector).addClass('pod-line');
149149
}
150+
});
150151

151-
pre.find('.syntaxhighlighter .gutter .line').each(function(i, el) {
152+
if (source.length) {
153+
source.find('.syntaxhighlighter .gutter .line').each(function(i, el) {
152154
var res;
153155
if (res = el.className.match(/(^|\s)number(\d+)(\s|$)/)) {
154156
var id = 'L' + res[2];
155157
$(el).contents().wrap('<a href="#'+id+'" id="'+id+'"></a>');
156158
}
157159
});
158-
});
160+
}
159161
});
160162

161163
function togglePod() {

0 commit comments

Comments
 (0)