Field HTML trim

Component ID

2118939

Component name

Field HTML trim

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

3413

Component created

Component changed

Component body

A Field formatter settings implementation to enable trimming without counting HTML tags. This has been a long standing issue with Drupal text_trimmed formatter. Following issues address this problem:

This module provides a neat solution for cutting off the text without taking any HTML tags into consideration. It uses a regular expression containing all the words of a trimmed textual representation of the field value to extract the wanted block of HTML.

This is a simple solution for anyone that just wants their teasers to have the same textual length regardless of any links, images or other tags that are in the field value. This module does not provide a way to cut off at the end of a sentence. It goes up to word level.