File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ var copyMarkdownSnippetFromGithub = (function(){ // ES6 modules are not supporte
1919 }
2020
2121 function convertLineElToText ( lineEl ) {
22- let lines = Array . from ( lineEl . querySelector ( '.react-file-line' ) . childNodes ) ;
22+ let lines = Array . from ( lineEl . childNodes ) ;
2323 let textFragments = Array . prototype . map . call ( lines , line => line . textContent )
2424 return textFragments . join ( '' )
2525 }
@@ -28,7 +28,7 @@ var copyMarkdownSnippetFromGithub = (function(){ // ES6 modules are not supporte
2828 // Read code lines highlighted on GitHub page, return multiline string
2929 let lines = Array . from ( document . querySelectorAll ( '.highlighted-line' ) ) ;
3030 const numbers = lines . map ( line => line . getAttribute ( 'data-line-number' ) ) ;
31- let texts = numbers . map ( number => document . querySelector ( `[data-key=" ${ number - 1 } "]` ) )
31+ let texts = numbers . map ( number => document . querySelector ( `[id="LC ${ number } "]` ) )
3232 if ( texts . length === 0 ) {
3333 texts = document . querySelectorAll ( 'div[aria-current]' ) ;
3434 }
You can’t perform that action at this time.
0 commit comments