stephenscaff / read-smore

A little Read More JS thing
https://stephenscaff.github.io/read-smore/
MIT License
28 stars 7 forks source link

if maximum word count is not exceeded = do nothing #16

Closed reilldesign closed 1 year ago

reilldesign commented 1 year ago

Hi, thanks for this extremely lightweight solution. We use this in a Joomla CMS blog override. Is there a way that the read more button only appears when the maximum word count is exceeded. In the other case truncating is not necessary. Sometimes there is only very short text

stephenscaff commented 1 year ago

Yep, you're correct. This is a bug.

I just pushed a fix to fix/less-than-count.

I'll add some tests, merge and deploy it asap.

Thanks.

stephenscaff commented 1 year ago

Published update. Take a look. Going to review a bit then close this.

stephenscaff commented 1 year ago

Okay, closing this now. Here's a code sandbox that tests 4 options:

Let me know if you have any other issues.