BSD Ports

textproc/p5-HTML-Truncate 0.20_1 DragonFly

Truncate HTML by character count while preserving well-formedness

System
DragonFly
Repository
DPorts
Maintainer
[email protected] (as in FreeBSD)
Categories
perl5, textproc, www
Package size
13.3 KiB, 25.5 KiB installed

Description

When working with text it is convenient and common to want to truncate strings to make them fit a desired context. E.g., you might have a menu that is only 100px wide and prefer text doesn't wrap so you'd truncate it around 15-30 characters, depending on preference and typeface size. This is trivial with plain text and substr but with HTML it is somewhat difficult because whitespace has fluid significance and open tags that are not properly closed destroy well-formedness and can wreck an entire layout.

HTML::Truncate attempts to account for those two problems by padding truncation for spacing and entities and closing any tags that remain open at the point of truncation.

In the other systems

SystemPortVersion
DragonFlytextproc/p5-HTML-Truncate0.20_1
FreeBSDtextproc/p5-HTML-Truncate0.20_1

Install

Binary package:

pkg install p5-HTML-Truncate

From DPorts:

cd /usr/dports/textproc/p5-HTML-Truncate && make install clean

Dependencies

Run dependencies 3

No port depends on this one.