Fix truncate issue with preserve at true on last word
bug #104 Fix truncate issue with preserve at true on last word (jpetitcolas)

This PR was squashed before being merged into the 1.0.x-dev branch (closes #104).

Discussion
----------

Fix truncate issue with preserve at true on last word

Currently, using `truncate` filter allows to not cut a word in the middle, thanks to the `preserve` argument. However, the word is cut if it is the last word of the text. For instance, `My long sentence"|truncate(10, true)` would return `My long se...`.

This PR aims to fix this behavior, adding some unit tests to prove the bug resolution.

Commits
-------

1ec30de Fix truncate issue with preserve at true on last word
added travis configuration
updated filters registration
minor #95 updated filters registration (Trainmaster)

This PR was squashed before being merged into the 1.0.x-dev branch (closes #95).

Discussion
----------

updated filters registration

Use Twig_SimpleFilter instead of Twig_Filter_Function (deprecated as of
Twig 1.12).

Commits
-------

9149c07 updated filters registration
Merge branch 'master' of https://github.com/fabpot/Twig-extensions
Many fixes.