/** * HTML → markdown converter, zero dependencies (Claude Code bundles turndown; * this extension is loaded from ~/.pi/agent/extensions and stays dep-free). * Quality target: readable text with headings, links, lists, and code blocks * for an LLM — not perfect fidelity. Hard pages get the Jina fallback. * * Implemented as linear scans instead of regex passes: a hostile page of * unclosed tags must not trigger quadratic backtracking (a 5MB page of * `