Skip to content

Weird bug with pruneLength and Chinese text #22390

@lucasholder

Description

@lucasholder

Description

When the Chinese text in a MDX file is too long, excerpt(pruneLength: 250) returns an empty string. When the text is a bit shorter, it returns the expected string of length 250.

Steps to reproduce

I'm a gatsby noob, not sure how to make a smaller reproduction of the bug... Basically, I did gatsby new gatsby-prunelength-bug https://github.com/vim-labs/gatsby-theme-sky-lite-starter and changed last 2 blog posts, one with long Chinese text and other with shorter Chinese text. Here's the guilty line: https://github.com/vim-labs/gatsby-theme-sky-lite/blob/master/src/templates/home.js#L139

git clone https://github.com/lucasholder/gatsby-prunelength-bug.git;
cd gatsby-prunelength-bug;
npm install;
gatsby develop;

Screenshot 2020-03-18 21 03 36

Environment

gatsby 2.19.48

Metadata

Metadata

Assignees

Labels

type: bugAn issue or pull request relating to a bug in Gatsby

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions