( content: Plate.RootElement, field: RichTextType, imageCallback: (url: string) => string )
| 143 | }; |
| 144 | |
| 145 | export const rootElement = ( |
| 146 | content: Plate.RootElement, |
| 147 | field: RichTextType, |
| 148 | imageCallback: (url: string) => string |
| 149 | ): Md.Root => { |
| 150 | const children: Md.Content[] = []; |
| 151 | content.children?.forEach((child) => { |
| 152 | const value = blockElement(child, field, imageCallback); |
| 153 | |
| 154 | if (value) { |
| 155 | children.push(value); |
| 156 | } |
| 157 | }); |
| 158 | return { |
| 159 | type: 'root', |
| 160 | children, |
| 161 | }; |
| 162 | }; |
| 163 | |
| 164 | export function codeLinesToString(content: Plate.CodeBlockElement): string { |
| 165 | return (content.children || []) |
no test coverage detected