File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 3939 } ) ;
4040 } ) ;
4141
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
4443 function highlightLineNumbers ( ) {
4544 const match = window . location . hash . match ( / ^ # ? ( \d + ) (?: - ( \d + ) ) ? $ / ) ;
4645 if ( ! match ) {
7675 }
7776 }
7877
79- const handleLineNumbers = ( function ( ) {
78+ const handleLineNumbers = ( function ( ) {
8079 let prev_line_id = 0 ;
8180
8281 const set_fragment = name => {
122121 } ;
123122 } ( ) ) ;
124123
125- window . addEventListener ( "hashchange" , highlightLineNumbers )
124+ window . addEventListener ( "hashchange" , highlightLineNumbers ) ;
126125
127126 Array . from ( document . getElementById ( "line-numbers" ) . children [ 0 ] . children ) . forEach ( el => {
128127 el . addEventListener ( "click" , handleLineNumbers ) ;
Original file line number Diff line number Diff line change 130130 < div id ="source-code-container " class ="pure-u-1 pure-u-sm-17-24 pure-u-md-19-24 ">
131131 < div data-nosnippet class ="source-code "> < pre id ="line-numbers "> < code >
132132 {%- 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 >
134134 {%~ endfor -%}
135135 </ code > </ pre > </ div >
136136 < div id ="source-code " class ="source-code ">
You can’t perform that action at this time.
0 commit comments