Function
code
({ className: cls, children: codeChildren, ...rest })
Source from the content-addressed store, hash-verified
| 104 | remarkPlugins={[remarkGfm]} |
| 105 | components={{ |
| 106 | code({ className: cls, children: codeChildren, ...rest }) { |
| 107 | const isBlock = /language-/.test(cls ?? ""); |
| 108 | if (isBlock) { |
| 109 | return ( |
| 110 | <code className={cn("block text-surface-200", cls)} {...rest}> |
| 111 | {codeChildren} |
| 112 | </code> |
| 113 | ); |
| 114 | } |
| 115 | return <InlineCode {...rest}>{codeChildren}</InlineCode>; |
| 116 | }, |
| 117 | pre: ({ children: preChildren }) => <Pre>{preChildren}</Pre>, |
| 118 | }} |
| 119 | > |
Callers
nothing calls this directly
Tested by
no test coverage detected