readmeio / markdown

ReadMe's flavored Markdown parser and React-based rendering engine.
https://rdmd.readme.io
ISC License
33 stars 9 forks source link

fix: saving tables #942

Closed kellyjosephprice closed 1 month ago

kellyjosephprice commented 1 month ago
PR App RM-9793

🧰 Changes

Fixes saving 'complex' tables.

In a prior PR, I added a new node type tableau to represent tables with block content. This mostly worked for the editor, but not when doing mdx(mdast(doc)). This PR adds a transformer, so the a tableau is converted to a JSX table just like regular table's.

This also adds the check so, if a tableau no longer has block content, it's saved as markdown!

🧬 QA & Testing

Hard to test outside the main app.

kellyjosephprice commented 1 month ago

Not sure I fully understand the content logic, but generally makes sense to me so I'm good with this!

Well, it's mostly just looking for any block content in a table cell. Except for the case when the editor likes to wrap the table cell content in a paragraph. So it tries to ignore that paragraph.

rafegoldberg commented 1 month ago

This PR was released!

🚀 Changes included in v6.75.0-beta.76