summaryrefslogtreecommitdiff
path: root/internal/comic/artist.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/comic/artist.go')
-rw-r--r--internal/comic/artist.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/comic/artist.go b/internal/comic/artist.go
index 248e8c4..aa1dd5f 100644
--- a/internal/comic/artist.go
+++ b/internal/comic/artist.go
@@ -7,6 +7,7 @@ import (
"path/filepath"
"strings"
"time"
+ "unicode/utf8"
"codeberg.org/snonux/comicforge/internal/provider"
)
@@ -377,8 +378,8 @@ func buildPanelLayout(section string, pagePanels []string, panelCount int) strin
}
excerpt := strings.TrimSpace(section)
- if len(excerpt) > comicPromptMaxChars {
- excerpt = excerpt[:comicPromptMaxChars]
+ if utf8.RuneCountInString(excerpt) > comicPromptMaxChars {
+ excerpt = string([]rune(excerpt)[:comicPromptMaxChars])
if idx := strings.LastIndex(excerpt, " "); idx > 0 {
excerpt = excerpt[:idx]
}