File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
src/librustdoc/html/static/js Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -986,7 +986,13 @@ function preLoadCss(cssUrl) {
986986 } ( ) ) ;
987987
988988 window . rustdoc_add_line_numbers_to_examples = ( ) => {
989- onEachLazy ( document . getElementsByClassName ( "rust-example-rendered" ) , x => {
989+ if ( document . querySelector ( ".rustdoc.src" ) ) {
990+ // We are in the source code page, nothing to be done here!
991+ return ;
992+ }
993+ onEachLazy ( document . querySelectorAll (
994+ ":not(.scraped-example) > .example-wrap > pre:not(.example-line-numbers)" ,
995+ ) , x => {
990996 const parent = x . parentNode ;
991997 const line_numbers = parent . querySelectorAll ( ".example-line-numbers" ) ;
992998 if ( line_numbers . length > 0 ) {
@@ -1005,12 +1011,8 @@ function preLoadCss(cssUrl) {
10051011 } ;
10061012
10071013 window . rustdoc_remove_line_numbers_from_examples = ( ) => {
1008- onEachLazy ( document . getElementsByClassName ( "rust-example-rendered" ) , x => {
1009- const parent = x . parentNode ;
1010- const line_numbers = parent . querySelectorAll ( ".example-line-numbers" ) ;
1011- for ( const node of line_numbers ) {
1012- parent . removeChild ( node ) ;
1013- }
1014+ onEachLazy ( document . querySelectorAll ( ".example-wrap > .example-line-numbers" ) , x => {
1015+ x . parentNode . removeChild ( x ) ;
10141016 } ) ;
10151017 } ;
10161018
You can’t perform that action at this time.
0 commit comments