werk85/node-html-to-text — pull request #27 by panta82 (2014-11-12 12:33:11+00:00)
Title: Added support for custom callback

The ability to add a "custom" element handler in the options.

```javascript
var options = {
custom: function (elem, options) {
if (elem.type === 'tag') {
return "fizz\n";
}
if (elem.type === 'text') {
return "buzz\n";
}
}
};
```

Custom functions takes the current element and options. It can return one of 3 things:

- `"string"`: It is appended to the `result`. No default processing.
- `false`: No default processing, element is skipped.
- `["string", false/true]`: First element is appended to the result. Second element allows/disallows default processing. Useful if we want to append some text and then proceed as usual (see example).

I also included an example where I demonstrate 2 use cases (this will hopefully be converted to unit tests at some point).

Also:
- I added .idea to `.gitignore` (this is for my IDE, you can revert it if you wish, but it doesn't hurt IMO)
- A few minor fixes in the demo code