-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit of github-trailing-whitespace
- Loading branch information
0 parents
commit a48f62f
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
lines = document.getElementsByClassName('blob-code-inner') | ||
for(var i=0; i<lines.length; i++) { | ||
var line = lines[i]; | ||
var lastChild = line.childNodes[line.childNodes.length-1]; | ||
if(lastChild.nodeType == lastChild.TEXT_NODE && /^\s+$/.test(lastChild.textContent)) { | ||
var span = document.createElement('span'); | ||
span.className = 'x'; | ||
span.innerText = lastChild.textContent; | ||
line.insertBefore(span, lastChild); | ||
line.removeChild(lastChild); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "GitHub Trailing Whitespace", | ||
"description": "This extension highlights trailing whitespace on GitHub diffs", | ||
"version": "1.0", | ||
"manifest_version": 2, | ||
"content_scripts": [{ | ||
"js": ["gh-trailing-ws.user.js"], | ||
"matches": ["https://github.com/*"] | ||
}] | ||
} |