Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions block.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"log"
"net/http"
"strings"
"time"
)

Expand Down Expand Up @@ -297,11 +298,11 @@ func (b BasicBlock) GetParent() *Parent {
return b.Parent
}
func concatenateRichText(richtext []RichText) string {
var result string
var text strings.Builder
for _, rt := range richtext {
result += rt.PlainText
text.WriteString(rt.PlainText)
}
return result
return text.String()
}

func (h Heading1Block) GetRichTextString() string {
Expand Down Expand Up @@ -385,7 +386,7 @@ func (b EquationBlock) GetRichTextString() string {
}

func (b BasicBlock) GetRichTextString() string {
return "No rich text of a basic block."
return ""
}

var _ Block = (*BasicBlock)(nil)
Expand Down
4 changes: 2 additions & 2 deletions block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package notionapi_test
import (
"context"
"encoding/json"
"io/ioutil"
"net/http"
"os"
"reflect"
"testing"
"time"
Expand Down Expand Up @@ -469,7 +469,7 @@ func TestBlockArrayUnmarshal(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
data, err := ioutil.ReadFile(tt.filePath)
data, err := os.ReadFile(tt.filePath)
if err != nil {
t.Fatal(err)
}
Expand Down