feat: image and link parser (#1744)

* feat: image and link parser

* chore: update
This commit is contained in:
boojack
2023-05-26 08:43:37 +08:00
committed by GitHub
parent 523ef2bba5
commit dbc85fe7e4
8 changed files with 252 additions and 18 deletions

View File

@ -13,11 +13,11 @@ func TestHeadingParser(t *testing.T) {
heading *HeadingParser
}{
{
text: "*Hello world!",
text: "*Hello world",
heading: nil,
},
{
text: "## Hello World!",
text: "## Hello World",
heading: &HeadingParser{
Level: 2,
ContentTokens: []*tokenizer.Token{
@ -31,7 +31,7 @@ func TestHeadingParser(t *testing.T) {
},
{
Type: tokenizer.Text,
Value: "World!",
Value: "World",
},
},
},
@ -65,12 +65,12 @@ func TestHeadingParser(t *testing.T) {
},
},
{
text: " # 123123 Hello World!",
text: " # 123123 Hello World",
heading: nil,
},
{
text: `# 123
Hello World!`,
Hello World`,
heading: &HeadingParser{
Level: 1,
ContentTokens: []*tokenizer.Token{