|
|
4 ay önce | |
|---|---|---|
| HTMLTextAttribute.cs | 4 ay önce | |
| HTMLUtility.cs | 4 ay önce | |
| README.md | 4 ay önce |
A lightweight helper class for Acumatica customizations and extensions that need to process, sanitize, or extract readable text from HTML content.
HtmlUtilities provides static helper methods for converting HTML strings to plain text, counting words, and truncating text safely.
It leverages the HtmlAgilityPack library to parse and traverse HTML nodes efficiently, ensuring that only meaningful content is preserved.
This utility is particularly useful for Acumatica developers dealing with HTML-based user inputs, API responses, or custom field rendering.
...) when needed.<script> and <style> blocks and preserves paragraph/line breaks.```csharp using PX.Data;
string html = "
Hello Acumatica Developer!
"; string plain = HtmlUtilities.ConvertToPlainText(html); // plain => "Hello Acumatica Developer!"int wordCount = HtmlUtilities.CountWords(plain); // wordCount => 3
string shortened = HtmlUtilities.Cut(plain, 10); // shortened => "Hello ..."