Skip to content

Commit 303af2a

Browse files
committed
Fix indentation of JSX inside of list item inside of JSX
1 parent e5b6658 commit 303af2a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,9 @@ function containerFlow(parent, state, info) {
772772
function inferDepth(state) {
773773
let depth = 0
774774

775-
for (const x of state.stack) {
775+
for (let i = state.stack.length - 1; i >= 0; i--) {
776+
const x = state.stack[i]
777+
if (x === 'listItem') break;
776778
if (x === 'mdxJsxFlowElement') {
777779
depth++
778780
}

0 commit comments

Comments
 (0)