Improve editor, plugin updates, and window transfers for 0.1.41
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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 = '<html><body><!--StartFragment--><table><tr><th>Ticker</th><th>Name</th></tr><tr><td>ADBE.US</td><td>Adobe</td></tr><tr><td>ADSK.US</td><td>Autodesk</td></tr></table><!--EndFragment--></body></html>';
|
||||
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 = '<table><tr><th>Notes</th></tr><tr><td>First<!-- multi-line\n <b>comment</b> --> part<br><strong>Second</strong></td></tr></table>';
|
||||
assert.equal(htmlToMarkdown(html), '| Notes |\n| --- |\n| First part<br>**Second** |');
|
||||
});
|
||||
|
||||
test("escaped comment text remains user content", () => {
|
||||
assert.equal(htmlToMarkdown('<p><!--Example--></p>'), '<!--Example-->');
|
||||
});
|
||||
Reference in New Issue
Block a user