-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
fix: remark excerpt add halfChop option #6992
fix: remark excerpt add halfChop option #6992
Conversation
default prune won't work for non english text
Deploy preview for using-postcss-sass failed. Built with commit c029622 https://app.netlify.com/sites/using-postcss-sass/deploys/5b687303e39e7c5e43b60c8a |
Deploy preview for using-drupal ready! Built with commit c029622 |
Deploy preview for gatsbygram failed. Built with commit c029622 https://app.netlify.com/sites/gatsbygram/deploys/5b687302e39e7c5e43b60c81 |
Could we detect this automatically? that prune is failing and automatically switch to If not then this looks good, not sure about |
@pieh So sorry about confusing name
How about just rename it to For detect failing case automatically, I think there is no straightforward way. |
|
Deploy preview for gatsbyjs failed. Built with commit c029622 https://app.netlify.com/sites/gatsbyjs/deploys/5b687301e39e7c5e43b60c7e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some wording nitpicking
|
||
### Excerpts for non-latin languages | ||
|
||
By default, excerpts is avoid half-chopped words when truncating content. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about something like this:
By default,
excerpt
usesunderscore.string/prune
which doesn't handle non-latin characters (esamattis/underscore.string#418).If that is the case, you can set
truncate
option onexcerpt
field, like:
and your query after that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍, updated.
Deploy preview for using-contentful failed. Built with commit 48427c2 https://app.netlify.com/sites/using-contentful/deploys/5b769c00c6aed639492db91c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Error VMError
Dangerfile
Generated by 🚫 dangerJS |
* fix: remark excerpt add halfChop option default prune won't work for non english text * remark: renamed prune option, added docs * transformer-remark readme wording changes * Update README.md
Default prune won't work for non-english text. Add
halfChop
(default to true) option, set it to false so that non-english blogs will make it fallback to lodashtruncate
.I think this resolve #6916