File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ lines = document . getElementsByClassName ( 'blob-code-inner' )
2+ for ( var i = 0 ; i < lines . length ; i ++ ) {
3+ var line = lines [ i ] ;
4+ var lastChild = line . childNodes [ line . childNodes . length - 1 ] ;
5+ if ( lastChild . nodeType == lastChild . TEXT_NODE && / ^ \s + $ / . test ( lastChild . textContent ) ) {
6+ var span = document . createElement ( 'span' ) ;
7+ span . className = 'x' ;
8+ span . innerText = lastChild . textContent ;
9+ line . insertBefore ( span , lastChild ) ;
10+ line . removeChild ( lastChild ) ;
11+ }
12+ }
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " GitHub Trailing Whitespace" ,
3+ "description" : " This extension highlights trailing whitespace on GitHub diffs" ,
4+ "version" : " 1.0" ,
5+ "manifest_version" : 2 ,
6+ "content_scripts" : [{
7+ "js" : [" gh-trailing-ws.user.js" ],
8+ "matches" : [" https://github.com/*" ]
9+ }]
10+ }
You can’t perform that action at this time.
0 commit comments