fix(shared): keep block markers after a task checkbox as visible text

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
marshallandClaude Opus 5.5 committed 2026-11-06 23:34:42 -08:00
1 parent 8693c2303f
commit 47591a3410
2 files changed
+5 -1

No files matched your search

@@ -99,6 +99,8 @@ describe("document text projection", () => {
it("keeps text the renderer shows literally", () => {
expect(projectMarkdownToText("# - Roadmap").text).toBe("- Roadmap");
expect(projectMarkdownToText("> # - Quoted heading").text).toBe("- Quoted heading");
expect(projectMarkdownToText("- [ ] # Release").text).toBe("# Release");
expect(projectMarkdownToText("- [x] - Shipped").text).toBe("- Shipped");
expect(projectMarkdownToText("Intro\n\n| --- |").text).toBe("Intro ---");
expect(projectMarkdownToText("| A | B |\n| --- | --- |\n| 1 | 2 |").text).not.toContain("---");
expect(projectMarkdownToText("Show \\&amp; and &Amp; and &constructor;").text)
+3 -1
View File
@@ -275,9 +275,11 @@ function stripBlockSyntax(line: string, absoluteOffset: number): { text: string;
consumed += quote[0].length;
continue;
}
const listItem = rest.match(/^\s*(?:[-+*]|\d+[.)])\s+(?:\[[ xX]\]\s+)?/);
const listItem = rest.match(/^\s*(?:[-+*]|\d+[.)])\s+(\[[ xX]\]\s+)?/);
if (listItem) {
consumed += listItem[0].length;
// A task checkbox starts the item's paragraph, so markers after it stay visible.
if (listItem[1]) break;
continue;
}
// Heading text is inline content, so markers after `#` stay visible.