ink
ink copied to clipboard
Truncate without …
I'm trying to create an app with ink.js and I need to truncate a string, but without …
.
I looked through the code of the <Text>
component, but it just passes the wrap
property on to an underlying <ink-text>
component which AFAIK puts altering the way truncation works out of my reach.
I tried limiting the size of the box but leaving wrap
set to its default value "wrap"
, but that resulted in the text wrapping out of its container and overwriting components that came after it – not exactly ideal.
Is there some way to truncate text without adding the …
character?
I'd love if we could just have a prop truncateCharacter
that we can pass to <Text>
to alter the …
character.
I'll try to write a PR for this right now
Update: Currently waiting for PR sindresorhus/cli-truncate#19 to be merged, then I'll finish this up
Sounds like a valid use case, looking forward to the PR!
Closing until more users want this.