mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: implement gomark parsers
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user