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
We can no longer add contrib projects in the Tugboat sandboxes that we use for core PR's? Can this be fixed or is there a reason for this? We can add contrib projects to demo...
Apr 25th Weekly Meetings
The Mail System and MimeMail modules are now installed. I'll let you know if they solve the problem. Edit: Using Mail System with MimeMail I was able to send plain text emails. There is...
HTML Email treated as plain text
If you haven't already I recommend installing Mail System and MimeMail. The latter will help format emails as HTML and first helps with configuring which module will handle the formatting...
HTML Email treated as plain text