feat: implement gomark parsers

This commit is contained in:
Steven
2023-12-13 21:00:13 +08:00
parent 2d9c5d16e1
commit 453707d18c
28 changed files with 625 additions and 209 deletions

View File

@@ -1,6 +1,8 @@
package ast
type BaseInline struct{}
type BaseInline struct {
Node
}
type Text struct {
BaseInline
@@ -28,6 +30,34 @@ func (*Bold) Type() NodeType {
return NodeTypeBold
}
type Italic struct {
BaseInline
// Symbol is "*" or "_"
Symbol string
Content string
}
var NodeTypeItalic = NewNodeType("Italic")
func (*Italic) Type() NodeType {
return NodeTypeItalic
}
type BoldItalic struct {
BaseInline
// Symbol is "*" or "_"
Symbol string
Content string
}
var NodeTypeBoldItalic = NewNodeType("BoldItalic")
func (*BoldItalic) Type() NodeType {
return NodeTypeBoldItalic
}
type Code struct {
BaseInline
@@ -66,20 +96,6 @@ func (*Link) Type() NodeType {
return NodeTypeLink
}
type Italic struct {
BaseInline
// Symbol is "*" or "_"
Symbol string
Content string
}
var NodeTypeItalic = NewNodeType("Italic")
func (*Italic) Type() NodeType {
return NodeTypeItalic
}
type Tag struct {
BaseInline
@@ -91,3 +107,15 @@ var NodeTypeTag = NewNodeType("Tag")
func (*Tag) Type() NodeType {
return NodeTypeTag
}
type Strikethrough struct {
BaseInline
Content string
}
var NodeTypeStrikethrough = NewNodeType("Strikethrough")
func (*Strikethrough) Type() NodeType {
return NodeTypeStrikethrough
}