Countable
Countable copied to clipboard
ignoreReturns: true not respected
The default implementation of below does not respect the ignoreReturns: true
:
$( window ).on('load', function() {
Countable.on(
document.getElementById('my_area'),
counter => console.log(counter),
{
ignoreReturns: true
}
)
});
Doing so, the all
property still counts returns (enter/newline)
Thus, we always get a wrong character count when doing this:
$( window ).on('load', function() {
Countable.on(
document.getElementById('my_area'),
counter => document.getElementById('my_result').innerHTML = counter.all.toString(),
{
ignoreReturns: true
}
)
});
The doc clearly states that we shall use that option to Ignore returns when calculating the all property.
Suggestions?