python
for i in range(10):
print(i)
jsx
<ReactMarkdown
components={{
code({ node, inline, className, children, ...props }) {
const match = /language-(\w+)/.exec(className || "");
return !inline && match ? (
<SyntaxHighlighter
{...props}
children={String(children).replace(/\n$/, "")}
style={vsDarkPlus}
language={match[1]}
PreTag="div"
/>
) : (
<code {...props} className={className}>
{children}
</code>
);
},
}}
>
{post.markdown}
</ReactMarkdown>
普通の文をコピーする際にも、コピー機能は使える🎵
This copy function can be applied to normal sentence as well.
For exmample, this sentence is set as HTML.