Rendering
Nodes & Marks
function renderBlock(props, editor, next) {
const { node, attributes, children } = props
switch (node.type) {
case 'paragraph':
return <p {...attributes}>{children}</p>
case 'quote':
return <blockquote {...attributes}>{children}</blockquote>
case 'image': {
const src = node.data.get('src')
return <img {...attributes} src={src} />
}
default:
return next()
}
}
function renderInline(props, editor, next) {
...
}
<Editor
renderBlock={renderBlock}
renderInline={renderInline}
...
/>The Editor Itself
Last updated