Skip to content

Reading time with hasCJKLanguage is computed as if text was purely CJK  #10031

Open
@DeinAlptraum

Description

@DeinAlptraum

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.102.0-DEV-15463f835bbadd6f86158b83cb1499721ae2269f linux/amd64 BuildDate=2022-06-16T07:51:58Z VendorInfo=mage

Does this issue reproduce with the latest release?

Yes

Currently, the reading time is computed as (p.wordCount + 212) / 213 for non-CJK languages, or (p.wordCount + 500) / 501 for CJK languages. See here.

It seems like a page is treated as CJK as long as at least one CJK character in it is recognized, and also hasCJKLanguage is set to true in the config.

This obviously leads to incorrect reading times on pages with mixed CJK/non-CJK content: the reading time is computed as if the content was purely CJK even if there’s only e.g. a single Kanji somewhere in there.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions