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

set maxLength to words instead of characters #16

Open
omrirz opened this issue Sep 10, 2021 · 1 comment
Open

set maxLength to words instead of characters #16

omrirz opened this issue Sep 10, 2021 · 1 comment

Comments

@omrirz
Copy link

omrirz commented Sep 10, 2021

Hi,
I had a use case where I wanted to clip by number of words and not by characters.
Before I go and implement it, I wanted to ask if you would like that functionality in text-clipper?

@arendjr
Copy link
Owner

arendjr commented Sep 10, 2021

Hi there, I am a little curious as to the actual usecase, but it seems like a reasonable request that would fit the library’s purpose. API-wise it could simply be a maxWords option, similar to maxLines, right? That way it can also be used in combination with the other limits, if desired.

I would certainly welcome a PR for this. Please provide a few tests and update the README. Also keep in mind it should work the same across HTML and plain-text clipping.

Cheers!

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

No branches or pull requests

2 participants