diff --git a/patches/mdast-util-from-markdown+2.0.3.patch b/patches/mdast-util-from-markdown+2.0.3.patch deleted file mode 100644 index c7eabf399357..000000000000 --- a/patches/mdast-util-from-markdown+2.0.3.patch +++ /dev/null @@ -1,75 +0,0 @@ -diff --git a/node_modules/mdast-util-from-markdown/lib/index.js b/node_modules/mdast-util-from-markdown/lib/index.js -index 90e17be..794871f 100644 ---- a/node_modules/mdast-util-from-markdown/lib/index.js -+++ b/node_modules/mdast-util-from-markdown/lib/index.js -@@ -287,6 +287,8 @@ function compiler(options) { - let firstBlankLineIndex; - /** @type {boolean | undefined} */ - let atMarker; -+ const insertPositions = []; -+ const insertEvents = []; - while (++index <= length) { - const event = events[index]; - switch (event[1].type) { -@@ -331,7 +333,7 @@ function compiler(options) { - if (listItem) { - let tailIndex = index; - lineIndex = undefined; -- while (tailIndex--) { -+ while (tailIndex-- > start) { - const tailEvent = events[tailIndex]; - if (tailEvent[1].type === "lineEnding" || tailEvent[1].type === "lineEndingBlank") { - if (tailEvent[0] === 'exit') continue; -@@ -353,9 +355,8 @@ function compiler(options) { - - // Fix position. - listItem.end = Object.assign({}, lineIndex ? events[lineIndex][1].start : event[1].end); -- events.splice(lineIndex || index, 0, ['exit', listItem, event[2]]); -- index++; -- length++; -+ insertPositions.push(lineIndex || index); -+ insertEvents.push(['exit', listItem, event[2]]); - } - - // Create a new list item. -@@ -369,16 +370,36 @@ function compiler(options) { - end: undefined - }; - listItem = item; -- events.splice(index, 0, ['enter', item, event[2]]); -- index++; -- length++; -+ insertPositions.push(index); -+ insertEvents.push(['enter', item, event[2]]); - firstBlankLineIndex = undefined; - atMarker = true; - } - } - } -+ // Apply deferred insertions in a single backward pass. -+ const insertCount = insertPositions.length; -+ if (insertCount > 0) { -+ const previousLength = events.length; -+ const rangeEnd = length; -+ events.length = previousLength + insertCount; -+ // Shift the tail to make room for insertions. -+ for (let t = previousLength - 1; t > rangeEnd; t--) { -+ events[t + insertCount] = events[t]; -+ } -+ // Merge original events with insertions, writing backwards. -+ let writeIndex = rangeEnd + insertCount; -+ let readIndex = rangeEnd; -+ for (let i = insertCount - 1; i >= 0; i--) { -+ const position = insertPositions[i]; -+ while (readIndex >= position) { -+ events[writeIndex--] = events[readIndex--]; -+ } -+ events[writeIndex--] = insertEvents[i]; -+ } -+ } - events[start][1]._spread = listSpread; -- return length; -+ return length + insertCount; - } - - /**