mirror of
https://github.com/bendtherules/react-to-markdown.git
synced 2026-08-18 13:53:11 +00:00
tagHandler - Add extra comment to explain pre and code dep
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user