Open faizhameed opened 3 years ago
renderNode: { [BLOCKS.PARAGRAPH]: (node, children) => { if ( node.content.length === 1 && node.content[0].value.length > 2 && node.content[0].marks.find((o) => o.type === "code") ) { console.log( typeof node.content[0].value, node.content[0].value.includes("//code_l") ); return ( <div className="gatsby-highlight"> {/* TODO: Get the type of language and fix based on the language */} <pre className={`language-js`}> <code>{node.content[0].value}</code> </pre> </div> ); } return <Text>{children}</Text>;