Skip to content
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

fix: migrating magic block tables with breaks #976

Merged
merged 2 commits into from
Sep 27, 2024

Conversation

kellyjosephprice
Copy link
Collaborator

PR App Ref CX-1112

🧰 Changes

Fixes breaks in magic block tables.

🧬 QA & Testing

Comment on lines +378 to +387
● One
● Two
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These newlines are unfortunate, but they render ok.

@kellyjosephprice kellyjosephprice marked this pull request as ready for review September 26, 2024 23:36
Comment on lines +33 to +35
visit(cell, 'break', (_, index, parent) => {
parent.children.splice(index, 1, { type: 'text', value: '\n' });
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this just converts breaks to a "\n" character? (any chance that'll break Shift+Return sequences within table cells? or any other potential externalities?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't, the editor doesn't create break nodes explicitly, but leaves it up the the current rendering library to decide how to serialize newlines. This is only an issue because remark < v8 used break nodes, but remark >=9 doesn't and just leaves the newlines in place.

This code should only trigger during the migration.

@kellyjosephprice kellyjosephprice merged commit b5092f2 into next Sep 27, 2024
13 checks passed
@kellyjosephprice kellyjosephprice deleted the fix/migrating-tables branch September 27, 2024 17:36
rafegoldberg pushed a commit that referenced this pull request Sep 27, 2024
## Version 7.6.2

### 🛠 Fixes & Updates

* migrating callouts ([#978](#978)) ([df0cb27](df0cb27))
* migrating image borders ([#977](#977)) ([c5ff7cd](c5ff7cd))
* migrating magic block tables with breaks ([#976](#976)) ([b5092f2](b5092f2))

<!--SKIP CI-->
@rafegoldberg
Copy link
Contributor

This PR was released!

🚀 Changes included in v7.6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants