chore: implement list nodes

This commit is contained in:
Steven
2023-12-16 08:51:29 +08:00
parent a10b3d3821
commit b00443c222
16 changed files with 283 additions and 20 deletions

View File

@@ -159,7 +159,7 @@ func (r *HTMLRender) renderLink(node *ast.Link) {
func (r *HTMLRender) renderTag(node *ast.Tag) {
r.output.WriteString(`<span>`)
r.output.WriteString(`# `)
r.output.WriteString(`#`)
r.output.WriteString(node.Content)
r.output.WriteString(`</span>`)
}

View File

@@ -30,6 +30,10 @@ func TestHTMLRender(t *testing.T) {
text: "**Hello** world!",
expected: `<p><strong>Hello</strong> world!</p>`,
},
{
text: "#article #memo",
expected: `<p><span>#article</span> <span>#memo</span></p>`,
},
}
for _, test := range tests {