Skip to content

Commit 9a350ce

Browse files
committed
Throw for two annotations in the same line
1 parent 2a93310 commit 9a350ce

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/mdx/src/smooth-code/annotations.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ function annotateMultilineSide(
205205
while (lineIndex < lines.length) {
206206
const annotation = annotations[0]
207207
let line = lines[lineIndex]
208+
if (
209+
annotation &&
210+
getLineNumber(line) > annotation.lineNumbers.start
211+
) {
212+
throw "Code Hike can't handle two annotations for the same line"
213+
}
208214
if (
209215
annotation &&
210216
getLineNumber(line) === annotation.lineNumbers.start

0 commit comments

Comments
 (0)