I use react-markdown to build the virtual dom which allows for updating only the changing DOM instead of completely overwriting. It generate the content in
tag. I want to add tag inside
tag.
<ReactMarkdown
components={
{
code({ node, inline, className, children, ...props }) {
const match = /language-(\w+)/.exec(className || '');
return !inline && match ? (
<SyntaxHighlighter
{...props}
style={a11yDark}
language={match[1]}
PreTag="div"
>
{String(children).replace(/\n$/, '')}
</SyntaxHighlighter>
) : (
<code {...props} className={className}>
{children}
</code>
);
},
}}
>
{content}
</ReactMarkdown>
tag and my archive is add a tag inside this
– Mai Trung Kiên Aug 07 '23 at 04:38tag
tag you can use a custom render function for the paragraph node type.
– Abhishek K V Aug 07 '23 at 05:12