Skip to content

Commit

Permalink
chore: remove unused node
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack committed Sep 17, 2024
1 parent b2451d1 commit e2e133b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
3 changes: 1 addition & 2 deletions ast/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const (
HorizontalRuleNode NodeType = "HORIZONTAL_RULE"
BlockquoteNode NodeType = "BLOCKQUOTE"
ListNode NodeType = "LIST"
ListItemNode NodeType = "LIST_ITEM"
OrderedListItemNode NodeType = "ORDERED_LIST_ITEM"
UnorderedListItemNode NodeType = "UNORDERED_LIST_ITEM"
TaskListItemNode NodeType = "TASK_LIST_ITEM"
Expand Down Expand Up @@ -55,7 +54,7 @@ type BaseNode struct {

func IsBlockNode(node Node) bool {
switch node.Type() {
case ParagraphNode, CodeBlockNode, HeadingNode, HorizontalRuleNode, BlockquoteNode, ListNode, ListItemNode, OrderedListItemNode, UnorderedListItemNode, TaskListItemNode, TableNode, EmbeddedContentNode:
case ParagraphNode, CodeBlockNode, HeadingNode, HorizontalRuleNode, BlockquoteNode, ListNode, OrderedListItemNode, UnorderedListItemNode, TaskListItemNode, TableNode, EmbeddedContentNode:
return true
default:
return false
Expand Down
19 changes: 3 additions & 16 deletions ast/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,8 @@ func (n *List) Restore() string {
return result
}

type ListItem struct {
BaseBlock
}

func (*ListItem) Type() NodeType {
return ListItemNode
}

func (*ListItem) Restore() string {
// Should be overridden.
return ""
}

type OrderedListItem struct {
ListItem
BaseBlock

// Number is the number of the list.
Number string
Expand All @@ -167,7 +154,7 @@ func (n *OrderedListItem) Restore() string {
}

type UnorderedListItem struct {
ListItem
BaseBlock

// Symbol is "*" or "-" or "+".
Symbol string
Expand All @@ -189,7 +176,7 @@ func (n *UnorderedListItem) Restore() string {
}

type TaskListItem struct {
ListItem
BaseBlock

// Symbol is "*" or "-" or "+".
Symbol string
Expand Down

0 comments on commit e2e133b

Please sign in to comment.