Skip to content

Commit

Permalink
Add border param to rich text list (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
kelseymills authored Nov 20, 2024
1 parent 6f9db6c commit bc58940
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion block_rich_text.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,20 @@ type RichTextList struct {
Style RichTextListStyle `json:"style"`
Elements []RichTextSection `json:"elements"`
Indent int `json:"indent"`
Border int `json:"border"`
}

func (l RichTextList) RichTextElementType() RichTextElementType {
return l.Type
}

func NewRichTextList(style RichTextListStyle, indentation int, elements ...RichTextSection) *RichTextList {
func NewRichTextList(style RichTextListStyle, indentation, border int, elements ...RichTextSection) *RichTextList {
return &RichTextList{
Type: RTEList,
Style: style,
Elements: elements,
Indent: indentation,
Border: border,
}
}

Expand All @@ -141,6 +143,7 @@ func (e *RichTextList) UnmarshalJSON(b []byte) error {
RawElements []json.RawMessage `json:"elements"`
Style RichTextListStyle `json:"style"`
Indent int `json:"indent"`
Border int `json:"border"`
}
if string(b) == "{}" {
return nil
Expand Down Expand Up @@ -173,6 +176,7 @@ func (e *RichTextList) UnmarshalJSON(b []byte) error {
Style: raw.Style,
Elements: elems,
Indent: raw.Indent,
Border: raw.Border,
}
return nil
}
Expand Down

0 comments on commit bc58940

Please sign in to comment.