import assert from "node:assert/strict";
import test from "node:test";
import { htmlToMarkdown } from "../../../src/lib/workspace/htmlToMarkdown.ts";
test("Windows HTML clipboard fragment comments do not become table content", () => {
const html = '
| Ticker | Name |
|---|
| ADBE.US | Adobe |
| ADSK.US | Autodesk |
';
assert.equal(htmlToMarkdown(html), '| Ticker | Name |\n| --- | --- |\n| ADBE.US | Adobe |\n| ADSK.US | Autodesk |');
});
test("comments inside cells preserve adjacent text and formatting", () => {
const html = '';
assert.equal(htmlToMarkdown(html), '| Notes |\n| --- |\n| First part
**Second** |');
});
test("escaped comment text remains user content", () => {
assert.equal(htmlToMarkdown('<!--Example-->
'), '');
});