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

Commite1e66b8

Browse files
authored
Merge pull request#6 from coderoad/test/line-breaks
test double line breaks
2 parentsd03625d +48afef7 commite1e66b8

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

‎tests/parse.test.ts

Lines changed: 37 additions & 0 deletions
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+
constmd=`# 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+
constyaml=`version: "0.1.0"
165+
levels:
166+
- id: L1
167+
`;
168+
constresult=parse(md,yaml);
169+
constexpected={
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)

[8]ページ先頭

©2009-2025 Movatter.jp