fix: forward node prop to Table component for AST-based index resolution\n\nThe table component mapping in MemoContent discarded the `node` prop\nfrom react-markdown, so `node.position.start.offset` was always\nundefined and the edit button never opened the table editor."

This commit is contained in:
milvasic 2026-03-11 21:48:17 +01:00
parent a759acc6a7
commit 9cbf5ebac4
1 changed files with 8 additions and 4 deletions

View File

@ -124,10 +124,14 @@ const MemoContent = (props: MemoContentProps) => {
// Code blocks
pre: CodeBlock,
// Tables
table: ({ children, ...props }) => <Table {...props}>{children}</Table>,
thead: ({ children, ...props }) => <TableHead {...props}>{children}</TableHead>,
tbody: ({ children, ...props }) => <TableBody {...props}>{children}</TableBody>,
tr: ({ children, ...props }) => <TableRow {...props}>{children}</TableRow>,
table: ({ children, node, ...props }) => (
<Table node={node} {...props}>
{children}
</Table>
),
thead: ({ children }) => <TableHead>{children}</TableHead>,
tbody: ({ children }) => <TableBody>{children}</TableBody>,
tr: ({ children }) => <TableRow>{children}</TableRow>,
th: ({ children, ...props }) => <TableHeaderCell {...props}>{children}</TableHeaderCell>,
td: ({ children, ...props }) => <TableCell {...props}>{children}</TableCell>,
}}