F10: interactive track-changes review in the markdown preview (#29) #30

Merged
benstull merged 17 commits from f10-interactive-review into main 2026-06-12 07:39:51 +00:00
2 changed files with 21 additions and 0 deletions
Showing only changes of commit 0311ad89ba - Show all commits
+10
View File
@@ -400,6 +400,16 @@ export function renderAuthorship(
.join("\n");
}
/** Off-state body: the current buffer as plain markdown, no annotations (INV-33). */
export function renderPlain(currentText: string, opts: RenderOptions = {}): string {
const render = opts.render ?? defaultRender;
try {
return render(currentText);
} catch (err) {
return chip(err instanceof Error ? err.message : String(err));
}
}
/** Pure entry point: annotated HTML body for the preview (INV-22). */
export function renderTrackChanges(
baselineText: string,
+11
View File
@@ -246,6 +246,17 @@ describe("colorByAuthor", () => {
});
});
import { renderPlain } from "../src/trackChangesModel";
describe("renderPlain", () => {
test("renderPlain renders current buffer as plain markdown (no marks)", () => {
const html = renderPlain("# Title\n\nhello");
expect(html).toContain("<h1>Title</h1>");
expect(html).toContain("hello");
expect(html).not.toContain("cw-");
});
});
import { renderTrackChanges as rtc2 } from "../src/trackChangesModel";
describe("renderTrackChanges — intra-diagram mermaid (#22)", () => {