tagHandler - Add extra comment to explain pre and code dep

This commit is contained in:
2019-12-22 04:38:50 +05:30
parent d86075f999
commit 046f561671
+1
View File
@@ -152,6 +152,7 @@ export default function handleTag(
// START - Handle pre.code // START - Handle pre.code
case 'pre': { case 'pre': {
// If structure looks like pre.code, call handleTag again on code tag with extraProps having inline:false
const childrenArray = ReactChildren.toArray(node.props.children); const childrenArray = ReactChildren.toArray(node.props.children);
if (childrenArray.length === 1) { if (childrenArray.length === 1) {
let onlyChild = childrenArray[0] as ReactElementSubsetWithPrimitive; let onlyChild = childrenArray[0] as ReactElementSubsetWithPrimitive;