Documentation
¶
Overview ¶
Package htmltext converts stored job-description HTML into alternative representations for consumers: plain text and Markdown. Each converter is lenient — a conversion error degrades to returning the input unchanged rather than failing the caller.
This file holds the description sanitizer: HTML processing with no knowledge of boards or postings, shared by packages outside ingest.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Sanitize ¶
Sanitize returns s with active content, media, and links removed, safe to render directly.
Self-labelled anchors are dropped BEFORE the policy runs: afterwards the unwrapped text can no longer be compared with its destination. The literal-newline repair runs first because it reads the surrounding markup and may emit a <br> the policy must vet.
func ToMarkdown ¶
ToMarkdown converts HTML to Markdown, preserving block structure such as lists and headings. On a conversion error it returns the (possibly truncated) input unchanged.
func ToText ¶
ToText renders HTML as plain text with tags removed. On a conversion error it returns the (possibly truncated) input unchanged.
func ToTextFull ¶
ToTextFull extracts the complete visible text for derivation, without wrapping, emphasis markers, truncation or caching. Text-node content is preserved and block elements add line boundaries. Plain text keeps its original line boundaries; on a parse error it returns the full input unchanged.
Types ¶
This section is empty.