File tree 2 files changed +4
-5
lines changed
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 39
39
} ) ;
40
40
} ) ;
41
41
42
- // This code has been adapted from the rustdoc implementation here:
43
- // https://github.com/rust-lang/rust/blob/5c848860/src/librustdoc/html/static/js/src-script.js#L152-L204
42
+ // This code has been adapted from the rustdoc implementation
44
43
function highlightLineNumbers ( ) {
45
44
const match = window . location . hash . match ( / ^ # ? ( \d + ) (?: - ( \d + ) ) ? $ / ) ;
46
45
if ( ! match ) {
76
75
}
77
76
}
78
77
79
- const handleLineNumbers = ( function ( ) {
78
+ const handleLineNumbers = ( function ( ) {
80
79
let prev_line_id = 0 ;
81
80
82
81
const set_fragment = name => {
122
121
} ;
123
122
} ( ) ) ;
124
123
125
- window . addEventListener ( "hashchange" , highlightLineNumbers )
124
+ window . addEventListener ( "hashchange" , highlightLineNumbers ) ;
126
125
127
126
Array . from ( document . getElementById ( "line-numbers" ) . children [ 0 ] . children ) . forEach ( el => {
128
127
el . addEventListener ( "click" , handleLineNumbers ) ;
Original file line number Diff line number Diff line change 130
130
< div id ="source-code-container " class ="pure-u-1 pure-u-sm-17-24 pure-u-md-19-24 ">
131
131
< div data-nosnippet class ="source-code "> < pre id ="line-numbers "> < code >
132
132
{%- for line in 1..=file_content.lines().count() -%}
133
- < a href ="#{{line|safe }} " id ="{{line|safe }} "> {{line|safe }}</ a >
133
+ < a href ="#{{line}} " id ="{{line}} "> {{line}}</ a >
134
134
{%~ endfor -%}
135
135
</ code > </ pre > </ div >
136
136
< div id ="source-code " class ="source-code ">
You can’t perform that action at this time.
0 commit comments