diamondburned
1dd36e0034
This commit clarifies text.Imager's (and therefore text.Avatarer's as well) bound behaviors. Prior to this commit, it is unclear which end bound an implementation should return. This commit clarifies that in order for the image to be inlined, the start must overlap the end bounds. This clarification was needed in order to differentiate images to be inlined with images to be associated with other contexts, such as Mentioned. The inline check would therefore be very simple: if start == end { if imager := segment.AsImager(); imager != nil { log.Println("Segment has an inline image.") } } Note that since there's now a way to explicitly define whether an image is inlined or not, for implementations that can't display images, the ImageText() should only be used if the image is actually inlined. Therefore, the same check also applies to ImageText(). This also applies to AvatarText(). |
||
---|---|---|
.. | ||
text.go | ||
text_extras.go |