Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gatsby-transformer-remark): Handle CJK characters for timeToRead #18303

Merged
merged 4 commits into from
Oct 9, 2019
Merged

Conversation

Austaras
Copy link
Contributor

@Austaras Austaras commented Oct 8, 2019

Description

Currently gatsby-transformer-remark uses lodash.words to count words for timeToRead which only count latin characters. This PR make it also count CJK characters

Related Issues

Fixes #17988

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@Austaras Austaras requested a review from a team as a code owner October 8, 2019 06:32
@wardpeet wardpeet added the status: awaiting author response Additional information has been requested from the author label Oct 8, 2019
@Austaras
Copy link
Contributor Author

Austaras commented Oct 8, 2019

After reading wiki I found that Korean Hangul is separated by spaces so they are covered by original count. So it's actually count CJ for timeToRead

@Austaras Austaras requested a review from wardpeet October 8, 2019 13:47
@sidharthachatterjee
Copy link
Contributor

@Austaras Perhaps some tests here might help?

@Austaras
Copy link
Contributor Author

Austaras commented Oct 9, 2019

test added

@sidharthachatterjee sidharthachatterjee removed the status: awaiting author response Additional information has been requested from the author label Oct 9, 2019
@sidharthachatterjee sidharthachatterjee self-requested a review October 9, 2019 08:06
Copy link
Contributor

@sidharthachatterjee sidharthachatterjee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for this @Austaras 🥇

@sidharthachatterjee sidharthachatterjee changed the title feat(gatsby-transformer-remark): count CJK for timeToRead feat(gatsby-transformer-remark): Handle CJK characters for timeToRead Oct 9, 2019
@sidharthachatterjee sidharthachatterjee merged commit cc6acdf into gatsbyjs:master Oct 9, 2019
@gatsbot
Copy link

gatsbot bot commented Oct 9, 2019

Holy buckets, @Austaras — we just merged your PR to Gatsby! 💪💜

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. We’ve got Gatsby t-shirts, stickers, hats, scrunchies, and much more. (You can also unlock even more free swag with 5 contributions — wink wink nudge nudge.) See gatsby.dev/swag for details.
  2. We just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. Accept the invite by visiting https://github.com/orgs/gatsbyjs/invitation. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again!

@devrsi0n
Copy link

Hi guys, I installed latest gatsby-transformer-remark@2.6.30 still can't fix this issue.😢

I don't think code publish successfully as node_modules code show below.
Snipaste_2019-10-24_20-59-44

gatsby repo master code show below.
image

🙏 Please fix the problem and republish this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Word count for CJK character
4 participants