Last active
June 11, 2017 08:44
-
-
Save baitisj/36c1abb91cac97a0833525ea7bc2a2c9 to your computer and use it in GitHub Desktop.
Bookmarklet to remove escape sequences from highlighted text
This file contains hidden or 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
javascript:( | |
function(){ | |
var range = window.getSelection().getRangeAt(0); | |
var a = document.createElement('a'); | |
a.setAttribute('href',document.location); | |
var t = window.getSelection().toString().replace(/\+/g, " "); | |
a.appendChild(document.createTextNode(decodeURIComponent(t))); | |
range.deleteContents(); | |
range.insertNode(a); | |
} | |
)() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment