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

Bug around preserveWord = true #96

Open
ttback opened this issue Aug 25, 2014 · 3 comments
Open

Bug around preserveWord = true #96

ttback opened this issue Aug 25, 2014 · 3 comments

Comments

@ttback
Copy link

ttback commented Aug 25, 2014

On Line 173: https://github.com/kswedberg/jquery-expander/blob/master/jquery.expander.js#L173

Shouldn't it be

summaryText = backup(summaryText, o.preserveWords && allHtml.slice(summaryText.length).length>0);

Current logic will ignore slicepoint when you set preserveword to true, basically truncating strings even if there's nothing to truncate.

@kswedberg
Copy link
Owner

Thanks for the report, @ttback . Would it be possible to provide an example of this failing? That way I can use it in my tests when I make a fix.

@kswedberg
Copy link
Owner

Any chance you can show me a snippet of html that fails?

@ttback
Copy link
Author

ttback commented Oct 4, 2014

@kswedberg sorry, never got around it, too busy hacking on some features. I don'r remember the particular example now, but I will try it with some example strings on Monday.

It is actually a very simple case, probably just any string that is shorter then truncate length would be truncated if you set 'preserveword' to be true.

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

No branches or pull requests

2 participants