({
children,
...props
}: React.ComponentPropsWithoutRef<'code'>)
| 374 | } |
| 375 | |
| 376 | export function Code({ |
| 377 | children, |
| 378 | ...props |
| 379 | }: React.ComponentPropsWithoutRef<'code'>) { |
| 380 | let isGrouped = useContext(CodeGroupContext); |
| 381 | |
| 382 | if (isGrouped) { |
| 383 | if (typeof children !== 'string') { |
| 384 | throw new Error( |
| 385 | '`Code` children must be a string when nested inside a `CodeGroup`.' |
| 386 | ); |
| 387 | } |
| 388 | return ( |
| 389 | <code {...props} dangerouslySetInnerHTML={{ __html: children }} /> |
| 390 | ); |
| 391 | } |
| 392 | |
| 393 | return <code {...props}>{children}</code>; |
| 394 | } |
| 395 | |
| 396 | export function Pre({ |
| 397 | children, |
nothing calls this directly
no outgoing calls
no test coverage detected