Skip to main content

Module text

Module text 

Source
Expand description

Plain-text conversion with reference-style URL preservation.

Links are not stripped to their domain, nor expanded inline. Instead each distinct URL is assigned a stable index and the anchor text is followed by a compact [N] marker. The full URLs are collected into a reference list that callers can append to the output or expose separately, so the agent sees [1] inline (≈1 token) but can still recover the exact link.

Functions§

html_to_text_with_refs
Convert an HTML document to reference-style plain text.
render_references
Render a reference list into the canonical block appended to text output. Thin wrapper over crate::refs::render_block.