From 0a117a25df082d549dcbf9996707bdf38f9164a5 Mon Sep 17 00:00:00 2001 From: Tatsunori Uchino Date: Thu, 25 Sep 2025 22:06:33 +0900 Subject: [PATCH] Fix 2 previous isolated high-surrogate code unit handling --- lib/inlines.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/inlines.js b/lib/inlines.js index a8d9d6ed..d2907b7a 100644 --- a/lib/inlines.js +++ b/lib/inlines.js @@ -320,7 +320,7 @@ var scanDelims = function(cc) { // NaN & 0xfc00 = 0 // checks if 2 previous char is high surrogate if ((two_previous_cc & 0xfc00) !== 0xd800) { - return previous_char; + return str.charAt(pos - 1); } return str.slice(pos - 2, pos); }