clean up Element.render surrogate handling.
This commit is contained in:
parent
0acae98979
commit
489aa2dbe3
|
@ -4011,9 +4011,9 @@ Element.prototype.render = function() {
|
|||
}
|
||||
|
||||
if (this.screen.fullUnicode && content[ci - 1]) {
|
||||
var point = unicode.codePointAt(content, ci - 1);
|
||||
// Handle combining chars:
|
||||
// Make sure they get in the same cell and are counted as 0.
|
||||
var point = unicode.codePointAt(content, ci - 1);
|
||||
if (unicode.combining[point]) {
|
||||
if (point > 0x00ffff) {
|
||||
ch = content[ci - 1] + content[ci];
|
||||
|
@ -4029,17 +4029,9 @@ Element.prototype.render = function() {
|
|||
}
|
||||
// Handle surrogate pairs:
|
||||
// Make sure we put surrogate pair chars in one cell.
|
||||
var code = content[ci - 1].charCodeAt(0);
|
||||
// if (unicode.codePointAt(content, ci - 1) > 0x00ffff) {
|
||||
// if (unicode.isSurrogate(content, ci - 1) {
|
||||
if (code >= 0xd800 && code <= 0xdbff) {
|
||||
var code2 = (content[ci] || '').charCodeAt(0);
|
||||
if (code2 >= 0xdc00 && code2 <= 0xdfff) {
|
||||
if (point > 0x00ffff) {
|
||||
ch = content[ci - 1] + content[ci];
|
||||
ci++;
|
||||
} else {
|
||||
ch = bch;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue