Skip to content

Commit 48afef7

Browse files
committed
test double line breaks
Signed-off-by: shmck <[email protected]>
1 parent d03625d commit 48afef7

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

tests/parse.test.ts

+37
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,41 @@ levels:
144144
};
145145
expect(result.levels[0].summary).toMatch(/\.\.\.$/);
146146
});
147+
148+
it("should match line breaks with double line breaks for proper spacing", () => {
149+
const md = `# Title
150+
151+
Description.
152+
153+
Second description line
154+
155+
## L1 Titles
156+
157+
First line
158+
159+
Second line
160+
161+
Third line
162+
`;
163+
164+
const yaml = `version: "0.1.0"
165+
levels:
166+
- id: L1
167+
`;
168+
const result = parse(md, yaml);
169+
const expected = {
170+
summary: {
171+
description: "Description.\n\nSecond description line",
172+
},
173+
levels: [
174+
{
175+
id: "L1",
176+
summary: "Some text that becomes the summary",
177+
content: "First line\n\nSecond line\n\nThird line",
178+
},
179+
],
180+
};
181+
expect(result.summary.description).toBe(expected.summary.description);
182+
expect(result.levels[0].content).toBe(expected.levels[0].content);
183+
});
147184
});

0 commit comments

Comments
 (0)