diff options
Diffstat (limited to 'helpers/content.go')
-rw-r--r-- | helpers/content.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/helpers/content.go b/helpers/content.go index f12a55ba8..d42995519 100644 --- a/helpers/content.go +++ b/helpers/content.go @@ -493,7 +493,10 @@ func totalWordsOld(s string) int { } // TruncateWordsByRune truncates words by runes. -func (c *ContentSpec) TruncateWordsByRune(words []string) (string, bool) { +func (c *ContentSpec) TruncateWordsByRune(in []string) (string, bool) { + words := make([]string, len(in)) + copy(words, in) + count := 0 for index, word := range words { if count >= c.summaryLength { |