Description of the need
People are often frustrated when they expect 600 characters of text, and get far fewer because their post contained an image, or other HTML. (source)
It's also frustrating when a text's trim length is quite short (e.g. 100 characters) and the first sentence is longer than this - this means that nothing gets output. (source)
Proposed solution
Field HTML Trim contains a function that truncates text - taking into account word boundaries, HTML trimming, ellipsis, etc. If we add this function to core, it'll mean we can trim text and ignore HTML tags (addressing the first problem), and trim to word boundaries instead of sentences or paragraphs (addressing the second problem).
Alternatives that have been considered
The Smart Trim module is another option, but it doesn't use the most robust method of truncating text. See https://github.com/backdrop/backdrop-issues/issues/599#issuecomment-1003... for a full explanation and comparison with Field HTML Trim.
Additional information
https://github.com/backdrop/backdrop-issues/issues/309 was opened to address the first problem originally. When the second problem was also pointed out in that issue, https://github.com/backdrop/backdrop-issues/issues/599 was then opened to address that separately.
As discussed in https://github.com/backdrop/backdrop-issues/issues/599#issuecomment-1019..., both of these issues can be fixed with the one function from Field HTML Trim. So trying to fix both separately isn't going to be ideal. This issue therefore deprecates and replaces both of those issues.
Draft of feature description for Press Release (1 paragraph at most)
Backdrop now includes the ability to truncate text while ignoring HTML tags and trimming to word boundaries.
Recent comments
I think given the warning on the source site: At this time, if your new project can afford to require PHP 5.5+, which it should, please use PHP's native password_hash() /...
July 31, 2025
I did a very quick test and if the Display format of the webform submission value is HTML then it appears but if plain text then it doesn't, so something is included regardless of if empty when...
"Hide rewriting if empty" has no effect
Just to clarify it appears that the item: Fix Search for "On the Web" module, is about the search on backdropcms.org at https://backdropcms.org/modules
July 31, 2025