Fixes end truncate behavior

The issue seems to be from the line:

```javascript
            if (total + index > maxLength) {
                // exceed given `maxLength`, dump everything to clear stack
                content += (string.substring(0, maxLength - total));
```

If the "dump everything" happens then it doesn't add an ellipsis

I used the example from #9 for the unit test, thanks @GriffinHeart