Registry Mirror
Skip to content

File tree

‎packages/shared/src/proposedPlanText.test.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ it("skips empty plan headings without reading into the next line", () => {
5858
}
5959
});
6060

61+
it("keeps plan titles that contain a Unicode line separator", () => {
62+
for (const separator of ["\u2028", "\u2029"]) {
63+
const markdown = `# Rollout${separator}check\n\n## Deploy\n\nBody`;
64+
expect(proposedPlanTitle(markdown)).toBe(`Rollout${separator}check`);
65+
expect(stripDisplayedPlanMarkdown(markdown)).toBe("## Deploy\n\nBody");
66+
}
67+
});
68+
6169
it("strips the displayed plan title and summary after leading blank lines", () => {
6270
const markdown = "\r\n# My Plan\r\n\r\n## Summary\r\n\r\nBody text";
6371
expect(proposedPlanTitle(markdown)).toBe("My Plan");

‎packages/shared/src/proposedPlanText.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { unified } from "unified";
44
const planParser = unified().use(remarkParse).freeze();
55

66
function headingText(line: string): string | null {
7-
const heading = line.match(/^ {0,3}#{1,6}([ \t].*)?$/);
7+
const heading = line.match(/^ {0,3}#{1,6}([ \t].*)?$/s);
88
if (!heading) return null;
99
const text = heading[1] ?? "";
1010
return text.replace(/[ \t]#+[ \t]*$/, "").trim();

0 commit comments

Comments
 (0)