darthapo/liquid.js — Issue #8: Truncate filter has incorrect behaviour
Author: alluran
Created: 2011-12-12 03:46:04+00:00
State: open

The line that sets the seg variable needs to be updated as follows:

```javascript
truncate: function (input, length, string) {
if (!input || input == '') { return ''; }
length = length || 50;
string = string || "...";

var seg = input.slice(0, length - string.length);
return seg + string;
},
```