This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony
Fabien Potencier d33a483575 feature #35649 [String] Allow to keep the last word when truncating a text (franmomu)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[String] Allow to keep the last word when truncating a text

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #35567
| License       | MIT
| Doc PR        | -

The [truncate filter from twig/extensions](https://github.com/twigphp/Twig-extensions/blob/master/src/TextExtension.php#L36) has a `preserve` parameter to preserve whole words.

Since `twig/extensions` is deprecated and its alternative for `truncate` filter is the use of `u` filter, this PR adds preverse word functionality.

Commits
-------

1cfaeec378 [String] Allow to keep the last word when truncating a text
2020-02-21 08:43:56 +01:00
..
Bridge feature #34550 [Form] Added an AbstractChoiceLoader to simplify implementations and handle global optimizations (HeahDude) 2020-02-12 20:40:35 +01:00
Bundle [Notifier] added Sinch texter transport 2020-02-17 17:10:29 +01:00
Component feature #35649 [String] Allow to keep the last word when truncating a text (franmomu) 2020-02-21 08:43:56 +01:00
Contracts [Contracts] Add changelog entry for "symfony/deprecation-contracts" 2020-02-14 10:07:39 +01:00