RECENT POSTS
- Introduction to FreeBSD Security Best Practices
- Working with Package Management in FreeBSD
- Understanding FreeBSD Security Advisories and Updates
- Troubleshooting Common System Administration Issues in FreeBSD
- Tips for Hardening FreeBSD to achieve System Protection
- Setting Up DHCP Server in FreeBSD
- Secure User and Group Management in FreeBSD Systems
- Secure Remote Access with SSH in FreeBSD
- Optimizing System Performance in FreeBSD
- Network Packet Capture with tcpdump in FreeBSD
- All posts ...
Do you have GDPR compliance issues ?
Check out Legiscope a GDPR compliance software, that will save you weeks of work, automating your documentation, the training of your teams and all processes you need to keep your organisation compliant with privacy regulations
P5-html-truncate
Jul 20, 2023
Truncate HTML by character count while preserving well-formedness
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.
HTMLTruncate 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.
- Older
- Newer
Checkout these related ports:
- Zxing-cpp - ZXing C++ Library for QR code recognition
- Zu-hunspell - Zulu hunspell dictionaries
- Zu-aspell - Aspell Zulu dictionary
- Zq - Easier and faster alternative to jq
- Zorba - General purpose C++ XQuery processor
- Zenxml - Simple C++ XML Processing
- Zed - Command-line tool to manage and query Zed data lakes
- Yq - Command-line YAML and XML processor, jq wrapper for YAML/XML documents
- Yould - Pronounceable word generator
- Yodl - Easy to use but powerful document formatting/preparation language
- Yi-hunspell - Yiddish hunspell dictionaries
- Yi-aspell - Aspell Yiddish dictionary
- Yelp-xsl - DocBook XSLT stylesheets for yelp
- Yelp-tools - Utilities to help manage documentation for Yelp and the web
- Ydiff - Diff readability enhancer for color terminals