|
|
@ -119,10 +119,11 @@ StateInline.prototype.scanDelims = function (start, canSplitWord) { |
|
|
// treat beginning of the line as a whitespace
|
|
|
// treat beginning of the line as a whitespace
|
|
|
if (pos <= 0) { return 0x20 } |
|
|
if (pos <= 0) { return 0x20 } |
|
|
const charCode = str.charCodeAt(pos - 1) |
|
|
const charCode = str.charCodeAt(pos - 1) |
|
|
// not low surrogates (BMP)
|
|
|
// not a low-surrogate code unit (is BMP code point)
|
|
|
if ((charCode & 0xFC00) !== 0xDC00) { return charCode } |
|
|
if ((charCode & 0xFC00) !== 0xDC00) { return charCode } |
|
|
|
|
|
|
|
|
// undefined if out of range (leading stray low surrogates)
|
|
|
// undefined if out of range (typically due to isolated low-surrogate code unit
|
|
|
|
|
|
// at the beginning of the string)
|
|
|
const codePoint = str.codePointAt(pos - 2) |
|
|
const codePoint = str.codePointAt(pos - 2) |
|
|
// undefined > 0xffff = false, so we don't need extra check here
|
|
|
// undefined > 0xffff = false, so we don't need extra check here
|
|
|
return codePoint > 0xffff ? codePoint : charCode |
|
|
return codePoint > 0xffff ? codePoint : charCode |
|
|
|