({ node, className, children, ...props })
| 142 | <ReactMarkdown |
| 143 | components={{ |
| 144 | code({ node, className, children, ...props }) { |
| 145 | const match = /language-(\w+)/.exec(className || '') |
| 146 | const inline = !match |
| 147 | |
| 148 | return !inline ? ( |
| 149 | <SyntaxHighlighter |
| 150 | style={atomDark} |
| 151 | language={match?.[1] || 'text'} |
| 152 | PreTag="div" |
| 153 | customStyle={{ |
| 154 | background: 'var(--dim)', |
| 155 | border: '1px solid var(--primary)', |
| 156 | borderRadius: '4px', |
| 157 | fontSize: '0.875rem' |
| 158 | }} |
| 159 | > |
| 160 | {String(children).replace(/\n$/, '')} |
| 161 | </SyntaxHighlighter> |
| 162 | ) : ( |
| 163 | <code |
| 164 | className="px-1 py-0.5 rounded text-sm" |
| 165 | style={{ |
| 166 | background: 'var(--dim)', |
| 167 | color: 'var(--primary)' |
| 168 | }} |
| 169 | {...props} |
| 170 | > |
| 171 | {children} |
| 172 | </code> |
| 173 | ) |
| 174 | }, |
| 175 | p({ children }) { |
| 176 | return <p className="mb-3 last:mb-0 leading-relaxed">{children}</p> |
| 177 | }, |
nothing calls this directly
no outgoing calls
no test coverage detected