Skip to content

Commit 9444135

Browse files
jpraetwxiaoguang
andauthored
Fix source code line highlighting (#18729)
Co-authored-by: wxiaoguang <[email protected]>
1 parent 91ac65d commit 9444135

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

web_src/js/features/repo-code.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ function selectRange($list, $select, $from) {
1616
const $issue = $('a.ref-in-new-issue');
1717
const $copyPermalink = $('a.copy-line-permalink');
1818

19-
if ($issue.length === 0 || $copyPermalink.length === 0) {
19+
if ($copyPermalink.length === 0) {
2020
return;
2121
}
2222

23-
const updateIssueHref = function(anchor) {
23+
const updateIssueHref = function (anchor) {
24+
if ($issue.length === 0) {
25+
return;
26+
}
2427
let href = $issue.attr('href');
2528
href = `${href.replace(/%23L\d+$|%23L\d+-L\d+$/, '')}%23${anchor}`;
2629
$issue.attr('href', href);

0 commit comments

Comments
 (0)