@gravity-ui/markdown-editor v15.13.3
@gravity-ui/markdown-editor ·

Markdown wysiwyg and markup editor
MarkdownEditor is a powerful tool for working with Markdown, which combines WYSIWYG and Markup modes. This means that you can create and edit content in a convenient visual mode, as well as have full control over the markup.
🔧 Main features
- Support for the basic Markdown and YFM syntax.
- Extensibility through the use of ProseMirror and CodeMirror engines.
- The ability to work in WYSIWYG and Markup modes for maximum flexibility.
Install
npm install @gravity-ui/markdown-editorRequired dependencies
Please note that to start using the package, your project must also have the following installed: @diplodoc/transform, react, react-dom, @gravity-ui/uikit, @gravity-ui/components and some others. Check out the peerDependencies section of package.json for accurate information.
Getting started
The markdown editor is supplied as a React hook to create an instance of editor and a component for rendering the view.\ To set up styling and theme see UIKit docs.
import React from 'react';
import {useMarkdownEditor, MarkdownEditorView} from '@gravity-ui/markdown-editor';
function Editor({onSubmit}) {
const editor = useMarkdownEditor({allowHTML: false});
React.useEffect(() => {
function submitHandler() {
// Serialize current content to markdown markup
const value = editor.getValue();
onSubmit(value);
}
editor.on('submit', submitHandler);
return () => {
editor.off('submit', submitHandler);
};
}, [onSubmit]);
return <MarkdownEditorView stickyToolbar autofocus editor={editor} />;
}Read more:
- How to connect the editor in the Create React App
- How to add preview for markup mode
- How to add HTML extension
- How to add Latex extension
- How to add Mermaid extension
- How to write extension
- How to add GPT extension
- How to add text binding extension in markdown
Development
To start the dev storybook
npm starti18n
To set up internationalization, you just need to use the configure:
import {configure} from '@gravity-ui/markdown-editor';
configure({
lang: 'ru',
});Don't forget to call configure() from UIKit and other UI libraries.
Contributing
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
10 months ago
9 months ago
11 months ago
1 year ago
11 months ago
1 year ago
1 year ago
7 months ago
7 months ago
8 months ago
11 months ago
11 months ago
11 months ago
10 months ago
10 months ago
10 months ago
9 months ago
9 months ago
1 year ago
1 year ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
12 months ago
9 months ago
9 months ago
12 months ago
12 months ago
11 months ago
9 months ago
9 months ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
8 months ago
8 months ago
11 months ago
11 months ago
9 months ago
11 months ago
9 months ago
1 year ago
1 year ago
1 year ago
10 months ago
1 year ago
8 months ago
8 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago