-
-
Notifications
You must be signed in to change notification settings - Fork 168
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
How to disable code highlighting feature #586
Comments
react-md-editor/core/src/Editor.tsx Lines 113 to 117 in a3f09f3
|
@omid This is the code highlighting language pack with markdown preview |
Ok, how can I remove that from the package @jaywcjlove ? |
@omid If you remove the default code highlighting, it will disappear. It's not easy to get rid of this package. |
How can I remove the default code highlighting? I set highlightEnable as |
@omid I thought of a perfect solution Provide a new component that does not contain import MDEditor from '@uiw/react-md-editor/nohighlight'; |
@omid upgrade Remove Code HighlightThe following example can help you exclude code highlighting code from being included in the bundle. import React from "react";
import MDEditor from '@uiw/react-md-editor/nohighlight';
const code = `**Hello world!!!**
\`\`\`js
function demo() {}
\`\`\`
`
export default function App() {
const [value, setValue] = React.useState(code);
return (
<div className="container">
<MDEditor
value={value}
onChange={setValue}
/>
<MDEditor.Markdown source={value} style={{ whiteSpace: 'pre-wrap' }} />
</div>
);
} |
Thanks a lot @jaywcjlove. It works 🎉 Now the package is 0.5MB smaller in gzip (1MB uncompressed). There is a tiny issue. After I upgrade to 3.25.0 and apply the changes. I'm getting this error:
So I needed to add a |
@omid Upgrade |
All is good, thanks @jaywcjlove |
Code highlighting feature is very large. And I actually don't need it at all.
How to disable it completely if we don't want to use code highlighting feature at all?
(I'm using Vite)
The text was updated successfully, but these errors were encountered: