diff --git a/angular-rich-text-diff.js b/angular-rich-text-diff.js index afe96b7..3343a15 100644 --- a/angular-rich-text-diff.js +++ b/angular-rich-text-diff.js @@ -42,8 +42,8 @@ var AngularRichTextDiff; var n = -1; do { n++; - } while (diffableString.charCodeAt(n) >= this.unicodeRangeStart); - if (n + 1 >= diffableString.length) { + } while (diffableString.charCodeAt(n) >= this.unicodeRangeStart + 1); + if (n >= diffableString.length) { return diffableString; } var openTag = ''; diff --git a/angular-rich-text-diff.ts b/angular-rich-text-diff.ts index a649502..e18482e 100644 --- a/angular-rich-text-diff.ts +++ b/angular-rich-text-diff.ts @@ -61,8 +61,8 @@ module AngularRichTextDiff { do { n++; } - while (diffableString.charCodeAt(n) >= this.unicodeRangeStart); - if (n + 1 >= diffableString.length) { + while (diffableString.charCodeAt(n) >= this.unicodeRangeStart + 1); + if (n >= diffableString.length) { return diffableString; } diff --git a/bower.json b/bower.json index 714ba99..6eb2d5c 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "angular-rich-text-diff", "main": "angular-rich-text-diff.js", - "version": "0.2.1", + "version": "0.2.2", "authors": [ "Bill Long " ],