(nodes: ReactNode[])
| 990 | } |
| 991 | |
| 992 | const normalizeOutput = (nodes: ReactNode[]): ReactNode => { |
| 993 | const trimmed = trimTrailingWhitespaceNodes(nodes) |
| 994 | if (trimmed.length === 0) { |
| 995 | return '' |
| 996 | } |
| 997 | if (trimmed.length === 1) { |
| 998 | return trimmed[0] |
| 999 | } |
| 1000 | return ( |
| 1001 | <> |
| 1002 | {trimmed.map((node, idx) => ( |
| 1003 | <KeyedFragment key={`markdown-out-${idx}`}>{node}</KeyedFragment> |
| 1004 | ))} |
| 1005 | </> |
| 1006 | ) |
| 1007 | } |
| 1008 | |
| 1009 | export function renderMarkdown( |
| 1010 | markdown: string, |
no test coverage detected