/ Published in: JavaScript
Add easily pre.prettyprint element for you code in the editor for blogger.
Only ejecute this script when you manage your post.
Note: version alpha.
Only ejecute this script when you manage your post.
Note: version alpha.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
_bt = document.createElement('button'); document.body.appendChild(_bt); _bt.innerHTML='>Pretty Print!<'; _bt.style.top='100px'; _bt.style.position='absolute'; _bt.onclick=function(){ var range = document.getElementById('postingComposeBox').contentDocument.getSelection().getRangeAt(0), content = range.extractContents(), pre = document.createElement('pre'); pre.innerHTML = content.textContent; pre.className = 'prettyprint'; var htmlContent = pre.innerHTML; range.insertNode(pre); };
URL: http://porquero.blogspot.com