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

The editor is stuck When value is large #620

Open
QiaoLi1996 opened this issue Feb 7, 2024 · 2 comments
Open

The editor is stuck When value is large #620

QiaoLi1996 opened this issue Feb 7, 2024 · 2 comments

Comments

@QiaoLi1996
Copy link

When there is a lot of content, the editor will become stuck, which should be caused by textarea performance. For example, there is the following scenario! [image] (base64). The image after base64 is relatively large, which will cause the editor to be very stuck. Personally, I think this needs to be fixed.

Any feasible solutions or suggestions for improvement, I would be very grateful.
image

@jaywcjlove
Copy link
Member

@QiaoLi1996 This is mainly caused by the code highlighting, and you can remove the code highlighting feature using the method below.

### Remove Code Highlight
The following example can help you _exclude code highlighting code_<!--rehype:style=color: #333;background-color: rgb(196 255 122 / 86%);--> from being included in the bundle. `@uiw/react-md-editor/nohighlight`<!--rehype:style=color: #e24444;--> component does not contain the ~~`rehype-prism-plus`~~ code highlighting package, ~~`highlightEnable`~~, ~~`showLineNumbers`~~ and ~~`highlight line`~~ functions will no longer work. ([#586](https://github.com/uiwjs/react-md-editor/issues/586))
```jsx mdx:preview
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>
);
}
```

@glundgren93
Copy link

Unfortunately, changing to nohighlight doesnt make much of a difference.
image

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

No branches or pull requests

3 participants