StaticExtractDetect content type from a MIME type string and extract text accordingly.
Currently supports:
For binary formats (PDF, DOCX, etc.), callers should use dedicated libraries (pdf-parse, officeparser) and then pass the extracted text through ExtractFromPlainText.
StaticExtractExtract readable text from HTML content. Strips tags, decodes entities, normalizes whitespace.
StaticExtractExtract and normalize plain text. Trims, normalizes whitespace, and removes control characters.
StaticTruncateTruncate text to a maximum token count (estimated). Truncates at the last whitespace boundary before the limit.
Shared text extraction utilities.
Provides static methods for extracting clean text from various content formats. These utilities are intentionally dependency-light — they use regex-based extraction rather than heavy DOM parsing libraries, making them suitable for server-side use without browser dependencies.