# HTML to Markdown test cases

Files for the post "Converting agent HTML to Markdown for an LLM: what survives, what breaks, and the limits I set" (/blog/html-to-markdown-for-llm-what-survives/).

- `inputs/`: twelve small, made-up HTML inputs, one per problem area. They are saved as `.html.txt` so the browser shows the markup instead of running it (one of them is full of `javascript:` links on purpose).
- `turndown/`: the unedited output of the post 01 script, `node to-md.mjs <input>` (/blog/examples/html-to-markdown/to-md.mjs).
- `turndown-v2/`: the unedited output of `node to-md-v2.mjs <input>`, the same script with the fixes from the post.
- `factrove/`: saved output from Factrove's private converter at commit `ee19eb0`. The converter is not included here, so these files are inspectable but not independently reproducible from this repository.
- `to-md-v2.mjs`: the updated script.

Versions used for every output here:

    Node.js 20.19.2
    turndown 7.2.4, turndown-plugin-gfm 1.0.2      (to-md.mjs, to-md-v2.mjs)
    Factrove converter at commit ee19eb0, parse5 7.3.0, compiled with TypeScript 5.9.3

Reproduce the Turndown outputs (rename an input to `.html` first, or pass the `.html.txt` path, it reads either):

    npm i turndown@7.2.4 turndown-plugin-gfm@1.0.2
    node to-md.mjs inputs/01-tables.html.txt
    node to-md-v2.mjs inputs/01-tables.html.txt

The Factrove converter isn't in this repository. The `factrove/` files are saved output you can inspect, not something you can reproduce from here.
