From 6609d69e61946a67d9691087e03a80d7aa66e6bf Mon Sep 17 00:00:00 2001 From: Eugene Date: Sat, 16 Nov 2024 23:15:45 +0200 Subject: [PATCH] BlockQuote -> BlockTypeQuote, BlockCallout -> BlockTypeCallout. Consistency is the king --- block.go | 5 +++-- const.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/block.go b/block.go index ea4ba45..50e65d0 100644 --- a/block.go +++ b/block.go @@ -387,6 +387,7 @@ func (b EquationBlock) GetRichTextString() string { func (b BasicBlock) GetRichTextString() string { return "No rich text of a basic block." } + var _ Block = (*BasicBlock)(nil) type ParagraphBlock struct { @@ -783,9 +784,9 @@ func decodeBlock(raw map[string]interface{}) (Block, error) { b = &Heading2Block{} case BlockTypeHeading3: b = &Heading3Block{} - case BlockCallout: + case BlockTypeCallout: b = &CalloutBlock{} - case BlockQuote: + case BlockTypeQuote: b = &QuoteBlock{} case BlockTypeBulletedListItem: b = &BulletedListItemBlock{} diff --git a/const.go b/const.go index 8586436..3bd7b79 100644 --- a/const.go +++ b/const.go @@ -226,8 +226,8 @@ const ( BlockTypeBookmark BlockType = "bookmark" BlockTypeCode BlockType = "code" BlockTypeDivider BlockType = "divider" - BlockCallout BlockType = "callout" - BlockQuote BlockType = "quote" + BlockTypeCallout BlockType = "callout" + BlockTypeQuote BlockType = "quote" BlockTypeTableOfContents BlockType = "table_of_contents" BlockTypeEquation BlockType = "equation" BlockTypeBreadcrumb BlockType = "breadcrumb"