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

[BUG] HTML tables get linebreaks added between rows #320

Open
2 tasks done
dave-db opened this issue Jan 19, 2024 · 2 comments
Open
2 tasks done

[BUG] HTML tables get linebreaks added between rows #320

dave-db opened this issue Jan 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@dave-db
Copy link

dave-db commented Jan 19, 2024

If you're unlucky enough to have an HTML table in your content, the editor adds line breaks to it between sections, which are then converted to implicit <p>s by the MDX renderer, which breaks table display.

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • I have read the documentation and cannot find an answer.

Describe the bug
Loading <table> content gets line breaks added in (visible in the diff viewer), which are then turned into ps when the MDX is rendered.

Reproduction
https://codesandbox.io/p/sandbox/mdx-editor-base-forked-y5mryt

To Reproduce
Steps to reproduce the behavior:
View the sandbox, switch to Diff mode to see the extra line breaks

Expected behavior
The <table> HTML should be left undisturbed

Desktop (please complete the following information):
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 22.6.0: Fri Sep 15 13:39:52 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_X86_64
Binaries:
Node: 20.10.0
npm: 10.2.3
Relevant Packages:
next: 14.0.4
eslint-config-next: 14.0.4
react: 18.2.0
react-dom: 18.2.0
typescript: 5.3.3

Chrome 119
mdx-editor: 2.3.4

@dave-db dave-db added the bug Something isn't working label Jan 19, 2024
@petyosi
Copy link
Contributor

petyosi commented Jan 19, 2024

I do understand your unlucky reference here. To be fair, I'm quite ambitious with my roadmap, but I don't foresee making HTML tables work in the near future. If I do that, I might rename the component to HTMLEditor :).

@dave-db
Copy link
Author

dave-db commented Jan 19, 2024

Completely understood. If there was a way to leave the table markup as-is (without being able to edit it outside source mode) that would be great, but no expectation of converting to markdown syntax or allowing proper table editing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants