// node --test src/: the Markdown the docs pages and release notes are rendered from. import { test } from "node:test"; import assert from "node:assert/strict"; import { markdown } from "./markdown.js"; test("a table renders with its header, cells and inline Markdown", () => { const html = markdown("| Way in | Status |\n| --- | :-: |\n| Rust | `cargo horizon-mod` |\n| Lua | planned \\| soon |\n\nAfter."); assert.equal( html, '
' + "
Way inStatus
Rustcargo horizon-mod
Luaplanned | soon
\n

After.

", ); }); test("a bar inside a code span stays in its cell", () => { assert.match(markdown("| a | b |\n|---|---|\n| `x | y` | z |"), /x \| y<\/code><\/td>z<\/td>/); }); test("rows without a rule line are a paragraph", () => { assert.equal(markdown("| a | b |\n| c | d |"), "

| a | b | | c | d |

"); }); test("a link whose label is code keeps it", () => { assert.equal(markdown("See [`AGENTS.md`](/docs/agents).", { site: true }), '

See AGENTS.md.

'); });