fix syntax highlighting warnings

This commit is contained in:
keyan 2023-07-27 12:10:05 -05:00
parent 566e3f427b
commit 7490e5c249

View File

@ -127,10 +127,10 @@ export default memo(function Text ({ topLevel, noFragments, nofollow, onlyImgPro
<table className='table table-bordered table-sm' {...props} /> <table className='table table-bordered table-sm' {...props} />
</span>, </span>,
p: ({ children, ...props }) => <div className={styles.p} {...props}>{children}</div>, p: ({ children, ...props }) => <div className={styles.p} {...props}>{children}</div>,
code ({ node, inline, className, children, ...props }) { code ({ node, inline, className, children, style, ...props }) {
return !inline return !inline
? ( ? (
<SyntaxHighlighter showLineNumbers style={atomDark} PreTag='div'> <SyntaxHighlighter showLineNumbers style={atomDark} PreTag='div' {...props}>
{reactStringReplace(String(children).replace(/\n$/, ''), /:high\[([^\]]+)\]/g, (match, i) => { {reactStringReplace(String(children).replace(/\n$/, ''), /:high\[([^\]]+)\]/g, (match, i) => {
return match return match
}).join('')} }).join('')}