|
|
@ -118,9 +118,8 @@ StateInline.prototype.scanDelims = function (start, canSplitWord) { |
|
|
|
function getLastCharCode (str, pos) { |
|
|
|
// treat beginning of the line as a whitespace
|
|
|
|
if (pos <= 0) { return 0x20 } |
|
|
|
const charCode = str.codePointAt(pos - 1) |
|
|
|
const charCode = str.charCodeAt(pos - 1) |
|
|
|
// not low surrogates (BMP)
|
|
|
|
// undefined & 0xFC00 = 0, but never happens thanks to the first if
|
|
|
|
if ((charCode & 0xFC00) !== 0xDC00) { return charCode } |
|
|
|
|
|
|
|
// undefined if out of range (leading stray low surrogates)
|
|
|
|