-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rich-text-from-markdown does not support table headers #352
Comments
@giovanni-caiazzo did you found a solution or work around for this? |
I removed all the headers and then treated the first row of any table as the header in my react app 😓 |
I used this dirty trick to split the header and body row(s): [BLOCKS.TABLE]: (_node: unknown, children: ReactNode): ReactNode => {
const [header, ...body] = children as ReactNode[];
return (
<Table.Root>
<Table.Header>{header}</Table.Header>
<Table.Body>{body}</Table.Body>
</Table.Root>
);
}, |
Looks like the underlying package doesn't recognise the notion of table header cells. Here is a quick demo But since markdown tables syntax enforces headers I think it's safe to assume the first row of a table is a header row. Would anyone be willing to submit a PR for this? |
@z0al, this is the same for the tables in rich text in Contentful, a syntax we don't control. Should I create a separate issue for that? |
What do you mean @LuudJanssen ? can you give an example please? |
Hi @z0al. I'm talking about header rows missing from the entire Contentful ecosystem. Ideally, both the converter from markdown to rich text, as well as the native rich text format (for the rich text field) in Contentful would produce something like:
Again, don't know if I'm in the right place reporting this enhancement. |
As per title, @contentful/rich-text-from-markdown does not support table headers in markdown. When I have this in markdown:
The tool responds with:
So, it detects the header part of the markdown (which is
|---|
) and removes it from the rich text, but does not promote the table-cells to table-header-cells.Is it possible to know when this feature will be available? Contentful itself supports table-header-cell node types, so I don't see why this tool should not use it.
Thank you for your time
The text was updated successfully, but these errors were encountered: