Skip to content

Commit 023c37f

Browse files
committed
only link line numbers on source page
1 parent 84da4e3 commit 023c37f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

root/static/js/syntaxhighlighter.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,17 @@ $(function () {
146146
).join(', ');
147147
pre.find('.syntaxhighlighter .line').filter(selector).addClass('pod-line');
148148
}
149+
});
149150

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

160162
function togglePod() {

0 commit comments

Comments
 (0)