Supports bi-directional import/export between MDX <=> Lexical. JSX will be mapped to lexical blocks back and forth. This will allow editing our mdx docs in payload while keeping mdx as the source of truth --------- Co-authored-by: Germán Jabloñski <43938777+GermanJablo@users.noreply.github.com>
25 lines
382 B
TypeScript
25 lines
382 B
TypeScript
import type { Block } from 'payload'
|
|
|
|
export const InlineCodeBlock: Block = {
|
|
slug: 'InlineCode',
|
|
jsx: {
|
|
import: ({ children }) => {
|
|
return {
|
|
code: children,
|
|
}
|
|
},
|
|
export: ({ fields }) => {
|
|
return {
|
|
props: {},
|
|
children: fields.code,
|
|
}
|
|
},
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'code',
|
|
type: 'code',
|
|
},
|
|
],
|
|
}
|