-
Notifications
You must be signed in to change notification settings - Fork 10
Conversation
@@ -1,7 +1,10 @@ | |||
describe('Handlebars.helpers.ellipsis', function() { | |||
|
|||
var tests = [ | |||
{ text: 'The quick brown fox', len: 12, expected: 'The quick...' } | |||
{ text: '', len: 1, expected: undefined }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure if this should be the expected behavior. I'd rather get the input if it couldn't be ellipsed (but that's off topic here, maybe)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you're completely right - it makes sense that if you pass an empty string you should get an empty string back. It's just a matter of changing this line to return "";
.
Would you like to make the change it or shall I do it?
@marianosimone It's also the first PR from an open source contributor! This is pretty damn cool, thanks for helping out. I'll have a look at this shortly. |
It's all good 👍 If you can just add the small |
@andrey-p fixed! |
Sweet, thanks for contributing! |
thanks @marianosimone! |
The
ellipsis
helper seem to be off regarding its limit.In the docs it says:
Shortens a string by removing words until string length is <= 'limit'...
, but then the code was using<
instead. Besides that, it was taking the space after the last word into account, when it shouldn't (as it's the last word, there shouldn't be a ws after it)💃 my first PR in this repo!!!