We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c5922c commit 28485e2Copy full SHA for 28485e2
packages/mdx/src/smooth-code/annotations.tsx
@@ -505,8 +505,11 @@ function shiftGroups(
505
): TokenGroup[] {
506
const removedGroups = [] as TokenGroup[]
507
let currentStartColumn = startColumn
508
- while (currentStartColumn < newStartColumn) {
509
- const currentTokenGroup = tokenGroups.shift()!
+ while (
+ currentStartColumn < newStartColumn &&
510
+ tokenGroups.length > 0
511
+ ) {
512
+ const currentTokenGroup = tokenGroups.shift()
513
removedGroups.push(currentTokenGroup)
514
const length = currentTokenGroup.tokens.reduce(
515
(a, t) => a + t.content.length,
0 commit comments