mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-11 20:03:58 +02:00
Fix .WordCount, .FuzzyWordCount, .ReadingTime when summary marker is set
This bug was introduced in Hugo 0.40. It is when you use the `<!--more-->` summary marker. Note that this affects the word stats only. The related `PlainWords`, `Plain`, `Content` all return correct values. Fixes #4675 Fixes #4682
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user