@portabletext/to-html
Version:
Render Portable Text to HTML
9 lines (6 loc) • 378 B
text/typescript
import type {PortableTextListComponent, PortableTextListItemComponent} from '../types'
export const defaultLists: Record<'number' | 'bullet', PortableTextListComponent> = {
number: ({children}) => `<ol>${children}</ol>`,
bullet: ({children}) => `<ul>${children}</ul>`,
}
export const DefaultListItem: PortableTextListItemComponent = ({children}) => `<li>${children}</li>`