mirror of
https://github.com/bendtherules/react-to-markdown.git
synced 2026-08-18 13:53:11 +00:00
renderer - Store nextParentASTNode separately
This commit is contained in:
+3
-2
@@ -23,6 +23,7 @@ function render(
|
|||||||
} else {
|
} else {
|
||||||
parentASTNodeMod = parentASTNode;
|
parentASTNodeMod = parentASTNode;
|
||||||
}
|
}
|
||||||
|
let nextParentASTNode = parentASTNodeMod;
|
||||||
|
|
||||||
if (node === null || node === undefined) {
|
if (node === null || node === undefined) {
|
||||||
// Handle (skip) null and undefined nodes
|
// Handle (skip) null and undefined nodes
|
||||||
@@ -70,7 +71,7 @@ function render(
|
|||||||
processChildren = false;
|
processChildren = false;
|
||||||
} else {
|
} else {
|
||||||
processChildren = true;
|
processChildren = true;
|
||||||
parentASTNodeMod = newParentASTNode;
|
nextParentASTNode = newParentASTNode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +84,7 @@ function render(
|
|||||||
children
|
children
|
||||||
) as ReactElementSubsetWithPrimitive[];
|
) as ReactElementSubsetWithPrimitive[];
|
||||||
|
|
||||||
render(renderOutput, parentASTNodeMod);
|
render(renderOutput, nextParentASTNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user