PHPackages                             ivovalchev/twig-truncate-html - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. ivovalchev/twig-truncate-html

ActiveTwig-extension[Templating &amp; Views](/categories/templating)

ivovalchev/twig-truncate-html
=============================

A Twig truncate\_html filter without breaking HTML tags.

1.0.0(6y ago)113.5k↓24%[1 PRs](https://github.com/I-Valchev/twig-truncate-html/pulls)MITPHPPHP &gt;=7.0.0

Since May 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/I-Valchev/twig-truncate-html)[ Packagist](https://packagist.org/packages/ivovalchev/twig-truncate-html)[ RSS](/packages/ivovalchev-twig-truncate-html/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

Installation
============

[](#installation)

```
composer require ivovalchev/twig-truncate-html

```

And add it to your `services.yaml`:

```
    app.twig_extension:
        class: IvoValchev\TruncateHtmlExtension\TruncateHtmlExtension
        tags:
            - { name: twig.extension }

```

How to use
==========

[](#how-to-use)

```
{{ "hello world"|truncate_html(5) }}

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2205d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/78ae1389d35ad7a4cda25bce02c73b64994823df39bc8bd023eea17dd4a54dc9?d=identicon)[I-Valchev](/maintainers/I-Valchev)

---

Top Contributors

[![I-Valchev](https://avatars.githubusercontent.com/u/7093518?v=4)](https://github.com/I-Valchev "I-Valchev (4 commits)")

### Embed Badge

![Health badge](/badges/ivovalchev-twig-truncate-html/health.svg)

```
[![Health](https://phpackages.com/badges/ivovalchev-twig-truncate-html/health.svg)](https://phpackages.com/packages/ivovalchev-twig-truncate-html)
```

###  Alternatives

[twig/extra-bundle

A Symfony bundle for extra Twig extensions

91492.0M315](/packages/twig-extra-bundle)[twig/intl-extra

A Twig extension for Intl

36763.2M221](/packages/twig-intl-extra)[rcrowe/twigbridge

Adds the power of Twig to Laravel

9105.9M50](/packages/rcrowe-twigbridge)[twig/string-extra

A Twig extension for Symfony String

22046.0M133](/packages/twig-string-extra)[twig/cssinliner-extra

A Twig extension to allow inlining CSS

22918.5M55](/packages/twig-cssinliner-extra)[symfony/ux-twig-component

Twig components for Symfony

21914.8M162](/packages/symfony-ux-twig-component)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
