Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit 9fff679

Browse files
Update image.go
1 parent a62f6c7 commit 9fff679

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

claat/nodes/image.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ type NewImageNodeOptions struct {
77
Width float32
88
Alt string
99
Title string
10+
Bytes []byte
1011
}
1112

1213
// NewImageNode creates a new ImageNode with the given options.
@@ -18,6 +19,7 @@ func NewImageNode(opts NewImageNodeOptions) *ImageNode {
1819
Width: opts.Width,
1920
Alt: opts.Alt,
2021
Title: opts.Title,
22+
Bytes: opts.Bytes,
2123
}
2224
}
2325

@@ -28,11 +30,12 @@ type ImageNode struct {
2830
Width float32
2931
Alt string
3032
Title string
33+
Bytes []byte
3134
}
3235

3336
// Empty returns true if its Src is zero, excluding space runes.
3437
func (in *ImageNode) Empty() bool {
35-
return strings.TrimSpace(in.Src) == ""
38+
return strings.TrimSpace(in.Src) == "" && len(in.Bytes) == 0
3639
}
3740

3841
// ImageNodes extracts everything except NodeImage nodes, recursively.

0 commit comments

Comments
 (0)