jquery-expander icon indicating copy to clipboard operation
jquery-expander copied to clipboard

Bug around preserveWord = true

Open ttback opened this issue 10 years ago • 3 comments

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.

ttback avatar Aug 25 '14 21:08 ttback

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 avatar Sep 10 '14 18:09 kswedberg

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

kswedberg avatar Oct 04 '14 01:10 kswedberg

@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.

ttback avatar Oct 04 '14 02:10 ttback