chore: add line break node

This commit is contained in:
Steven
2023-12-12 23:38:43 +08:00
parent aa3632e2ac
commit dd83782522
4 changed files with 73 additions and 0 deletions

View File

@ -61,6 +61,30 @@ func TestParser(t *testing.T) {
},
},
},
{
text: "Hello **world**!\n```javascript\nconsole.log(\"Hello world!\");\n```",
nodes: []ast.Node{
&ast.Paragraph{
Children: []ast.Node{
&ast.Text{
Content: "Hello ",
},
&ast.Bold{
Symbol: "*",
Content: "world",
},
&ast.Text{
Content: "!",
},
},
},
&ast.LineBreak{},
&ast.CodeBlock{
Language: "javascript",
Content: "console.log(\"Hello world!\");",
},
},
},
}
for _, test := range tests {