krux/postscribe — pull request #89 by crocodele (2014-11-07 16:45:46+00:00)
Title: New hook for handling tokens before they are written

Proposed solution to #87.

Example usage:
```javascript
postscribe('#container', '', {
beforeTokenWrite : function(tok)
{
if (location.protocol !== 'https:' || !tok.tagName)
return tok;

if (tok.tagName == 'script' && tok.src && tok.src.indexOf('http:') === 0)
{
console.log('leaving script from insecure source unwritten');
return null;
}

return tok;
}
});
```