Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ShMcK merged 1 commit intomasterfromtest/line-breaks
May 30, 2020
Merged
Changes fromall 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 deletionstests/parse.test.ts
View file
Open in desktop
Original file line numberDiff line numberDiff 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);
});
});

[8]ページ先頭

©2009-2025 Movatter.jp