diff --git a/README.md b/README.md index 10d3976..73d58a6 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ var myApp = angular.module('myApp', ['truncate']); ###When outputting text, apply the filter. ```html
- {{ text | characters:25 }} or {{ text | words:5 }} + {{ text | characters:25 }} or {{ text | splitcharacters:5 }} or {{ text | words:5 }}
``` @@ -32,4 +32,4 @@ By default, a _word_ will not be truncated. Set the optional boolean after the c{{ text | characters:25 :true}}
- ``` \ No newline at end of file + ``` diff --git a/src/truncate.js b/src/truncate.js index da77562..a11304c 100644 --- a/src/truncate.js +++ b/src/truncate.js @@ -29,7 +29,7 @@ angular.module('truncate', []) if (input && input.length > chars) { var prefix = input.substring(0, chars/2); var postfix = input.substring(input.length-chars/2, input.length); - return prefix + '...' + postfix; + return prefix + '…' + postfix; } return input; }; diff --git a/test/unit/filtersSpec.js b/test/unit/filtersSpec.js index 92bc175..1b0d025 100644 --- a/test/unit/filtersSpec.js +++ b/test/unit/filtersSpec.js @@ -115,11 +115,11 @@ describe('truncate', function () { }); it('should trim these down', function () { - expect(characterFilter('1234567890', 5)).toEqual('12...890'); + expect(characterFilter('1234567890', 5)).toEqual('12…890'); }); it('should trim this down including the space', function () { - expect(characterFilter('123456789 10 11 12 13 14', 13)).toEqual('123456...2 13 14'); + expect(characterFilter('123456789 10 11 12 13 14', 13)).toEqual('123456…2 13 14'); }); it('should handle invalid numbers', function () {