diff --git a/ast/ast.go b/ast/ast.go index c0ec0ce..3033891 100644 --- a/ast/ast.go +++ b/ast/ast.go @@ -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" @@ -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 diff --git a/ast/block.go b/ast/block.go index 695261b..62b91af 100644 --- a/ast/block.go +++ b/ast/block.go @@ -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 @@ -167,7 +154,7 @@ func (n *OrderedListItem) Restore() string { } type UnorderedListItem struct { - ListItem + BaseBlock // Symbol is "*" or "-" or "+". Symbol string @@ -189,7 +176,7 @@ func (n *UnorderedListItem) Restore() string { } type TaskListItem struct { - ListItem + BaseBlock // Symbol is "*" or "-" or "+". Symbol string