Skip to content

Instantly share code, notes, and snippets.

@tkrkt
Last active August 29, 2015 14:23
Show Gist options
  • Save tkrkt/e2445382cb21323acdc2 to your computer and use it in GitHub Desktop.
Save tkrkt/e2445382cb21323acdc2 to your computer and use it in GitHub Desktop.
SlideShareのテキスト文字参照化を直すグリモン
// ==UserScript==
// @name SlideShare-FixCharacterReference
// @namespace jp.tkrkt
// @include http://www.slideshare.net/*
// @version 1
// @grant none
// ==/UserScript==
//https://gist.github.com/myaumyau/4975024
function hexNumRefToString(hexNumRef) {
return hexNumRef.replace(/&#x([0-9a-f]+);/ig, function(match, $1, idx, all) {
return String.fromCharCode('0x' + $1);
});
}
var elems = document.querySelectorAll('.transcripts li[itemprop=text]');
Array.prototype.forEach.call(elems, function(elem){
elem.textContent = hexNumRefToString(elem.textContent);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment