Skip to content

test double line breaks #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions tests/parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,41 @@ levels:
};
expect(result.levels[0].summary).toMatch(/\.\.\.$/);
});

it("should match line breaks with double line breaks for proper spacing", () => {
const md = `# Title

Description.

Second description line

## L1 Titles

First line

Second line

Third line
`;

const yaml = `version: "0.1.0"
levels:
- id: L1
`;
const result = parse(md, yaml);
const expected = {
summary: {
description: "Description.\n\nSecond description line",
},
levels: [
{
id: "L1",
summary: "Some text that becomes the summary",
content: "First line\n\nSecond line\n\nThird line",
},
],
};
expect(result.summary.description).toBe(expected.summary.description);
expect(result.levels[0].content).toBe(expected.levels[0].content);
});
});