-
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
Use ellipsis instead of ...
for pruning excerpts
#2178
Conversation
Deploy preview ready! Built with commit c4afb8b |
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.
Awesome!
Yeah agree this is better. Surprised "prune" doesn't use an ellipsis by default…
And also definitely would take a PR adding an option for setting the truncation character.
@@ -254,7 +254,7 @@ module.exports = ( | |||
return getAST(markdownNode).then(ast => { | |||
const textNodes = [] | |||
visit(ast, `text`, textNode => textNodes.push(textNode.value)) | |||
return prune(textNodes.join(` `), pruneLength) | |||
return prune(textNodes.join(` `), pruneLength, '\u2026') |
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.
is it possible to just put the actual ellipsis character "…" in the code vs. this? I dislike looking up unicode characters and most terminals/editors display them just fine these days.
Thanks! Merging/publishing! |
Hiya @kripod! 👋 This is definitely late, but on behalf of the entire Gatsby community, I wanted to say thank you for being here. Gatsby is built by awesome people like you. Let us say “thanks” in two ways:
If you have questions, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’. Thanks again! 💪💜 |
Additionally, I would like to suggest adding a property for overriding the overflow indicator string.