mdx-editor / editor

A rich text editor React component for markdown
https://mdxeditor.dev
MIT License
1.75k stars 139 forks source link

[BUG] unable to "control" md code block formatting #382

Closed dogmatic69 closed 3 months ago

dogmatic69 commented 6 months ago

If you want to ask for support or request features, sponsor the project and contact me over email.

Describe the bug

Unable to control code blocks created from markdown triple back ticks. From a quick look at the code, seems to do internal things that does not pass through any configurations (eg: theme)

Reproduction

Simple mardkown setup with code blocks results in black blocks of code (due to "auto" dark theme due to system settings)

Expected behavior

I'm using this for non technical use, so I want the code block to be styled more simply but don't seem to be able to do anything related to style for mardkown code blocks.

Screenshots image

petyosi commented 6 months ago

This is a missing feature. The code blocks editor has be migrated to a plain codemirror setup (they use the sandpack config), and from there it's fairly easy to make them themeable, like the diff/source editors.

Happy to accept a PR.

dogmatic69 commented 6 months ago

Ok, at least I know. Not really familiar with this all so won't be able to make a PR.

petyosi commented 3 months ago

This is solved (solved a while back), just missed closing this feature. The codemirror plugin accepts codemirror options, which let you pass a theme plugin of your choice.