Skip to content

Commit 1a7b47c

Browse files
committed
setup test for content with a #
Signed-off-by: shmck <[email protected]>
1 parent 869c604 commit 1a7b47c

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

Diff for: tests/parse.test.ts

+47
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,53 @@ The third step
971971
expect(result.levels).toEqual(expected.levels)
972972
})
973973

974+
it('should load content with #', () => {
975+
// https://github.com/coderoad/coderoad-vscode/issues/479
976+
977+
const md = `# Title
978+
979+
Description line with # content and #content and ## content
980+
981+
## 1. Title
982+
983+
First line with # content and #content and ## content
984+
985+
### 1.1
986+
987+
Content line with # content and #content and ## content`
988+
const skeleton = {
989+
levels: [
990+
{
991+
id: '1'
992+
}
993+
]
994+
}
995+
const result = parse({
996+
text: md,
997+
skeleton,
998+
commits: {
999+
'1': ['abcdefg1']
1000+
}
1001+
})
1002+
const expected = {
1003+
summary: {
1004+
description:
1005+
'Description line with # content and #content and ## content'
1006+
},
1007+
levels: [
1008+
{
1009+
id: '1',
1010+
summary: 'First line with # content and #content and ## content',
1011+
content: 'Content line with # content and #content and ## content',
1012+
setup: {
1013+
commits: ['abcdefg1']
1014+
}
1015+
}
1016+
]
1017+
}
1018+
expect(result.levels[0].setup).toEqual(expected.levels[0].setup)
1019+
})
1020+
9741021
describe('config', () => {
9751022
it('should parse the tutorial config', () => {
9761023
const md = `# Title

0 commit comments

Comments
 (0)