Skip to content

Commit ff5e64e

Browse files
committed
no need to double-check second half of a surrogate pair
1 parent dbb78b4 commit ff5e64e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

notebook/static/base/js/utils.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,8 @@ define([
10311031
if (char_code >= 0xD800 && char_code <= 0xDBFF) {
10321032
var next_char_code = text.charCodeAt(i+1);
10331033
if (next_char_code >= 0xDC00 && next_char_code <= 0xDFFF) {
1034-
char_idx -= 1;
1034+
char_idx--;
1035+
i++;
10351036
}
10361037
}
10371038
}
@@ -1046,7 +1047,8 @@ define([
10461047
if (char_code >= 0xD800 && char_code <= 0xDBFF) {
10471048
var next_char_code = text.charCodeAt(i+1);
10481049
if (next_char_code >= 0xDC00 && next_char_code <= 0xDFFF) {
1049-
js_idx += 1;
1050+
js_idx++;
1051+
i++;
10501052
}
10511053
}
10521054
}

0 commit comments

Comments
 (0)