demoqa_22_test
Описание
Языки
- Java100%
test_latex
A simple markdown editor with preview, implemented with React.js and TypeScript. This React Component aims to provide a simple Markdown editor with syntax highlighting support. This is based on encapsulation, so it does not depend on any modern code editors such as Acs, CodeMirror, Monaco etc.
Features
- 📑 Indent line or selected text by pressing tab key, with customizable indentation.
- ♻️ Based on
encapsulation, does not depend on any modern code editors.textarea - 🚧 Does not depend on the
component library.uiw - 🚘 Automatic list on new lines.
- 😻 GitHub flavored markdown support.
- 🌒 Support dark-mode/night-mode @v3.11.0+.
- 💡 Support next.js, Use examples in next.js.
- Line/lines duplication (Ctrl+D) and movement (Alt+UpArrow/DownArrow) @v3.24.0+.
Quick Start
Using
Special Markdown syntax
Supports for CSS Style
Use HTML comments to let Markdown support style customization.
Ignore content display via HTML comments
Shown in GitHub readme, excluded in HTML.
Output:
Security
Please note markdown needs to be sanitized if you do not completely trust your authors. Otherwise, your app is vulnerable to XSS. This can be achieved by adding rehype-sanitize as a plugin.
Remove Code Highlight
The following example can help you exclude code highlighting code from being included in the bundle. component does not contain the code highlighting package, , and functions will no longer work. (#586)
Custom Toolbars
Customize the toolbar with and props.
re-render element.
Custom Preview Command Tool
Add Help Command Tool
Editor Font Size
Editor height adapts to text
The initial height can be adjusted through . Dragbar will automatically expire. You can hide the drag button through
Preview Markdown
Support Custom KaTeX Preview
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web, We perform math rendering through .
The following example is preview in CodeSandbox.
⚠️ Upgrade v2 to v3 d025430
Markdown text to Image
Support Custom Mermaid Preview
Using mermaid to generation of diagram and flowchart from text in a similar manner as markdown
Support Nextjs
Use examples in nextjs.
Support dark-mode/night-mode
By default, the is automatically switched according to the system. If you need to switch manually, just set the parameter for body.
Inherit custom color variables by adding selector. Setting theme styles with .
Props
: The Markdown value.value: string: Event handler for theonChange?: (value?: string, event?: React.ChangeEvent<HTMLTextAreaElement>, state?: ContextStore)event.onChange: editor height change listener.onHeightChange?: ((value?: CSSProperties['height'], oldValue?: CSSProperties['height'], state?: ContextStore)Some data on the statistics editor.onStatistics?: (data: Statistics) => void;: An array ofcommands?: ICommand[], which, each one, contain aICommandproperty. If no commands are specified, the default will be used. Commands are explained in more details below.commands: Filter or modify your commands.commandsFilter?: (command: ICommand, isExtra: boolean) => false | ICommand: Displayed on the right side of the toolbar.extraCommands?: ICommand[]: Can be used to makeautoFocus?: truefocus itself on initialization.Markdown Editor: This is reset @uiw/react-markdown-preview settings.previewOptions?: ReactMarkdown.ReactMarkdownProps: Set thetextareaProps?: TextareaHTMLAttributesrelated props.textarea:renderTextarea?: (props, opts) => JSX.Element;Please use@deprecated->renderTextarea. Use div to replace TextArea or re-render TextArea. #193components: re-render textarea/toolbar element. #419componentsUse div to replace TextArea or re-render TextAreatextareaOverride the default command element.toolbar<toolbarcommand[].renderCustom markdown preview. #429preview
: The height of the editor. ️⚠️height?: number=200is invalid whenDragbarparameter percentage.height: Show drag and drop tool. Set the height of the editor.visibleDragbar?: boolean=true: Disable editing area code highlighting. The value ishighlightEnable?: boolean=true, which increases the editing speed.false: Show markdown preview.fullscreen?: boolean=false: Disableoverflow?: boolean=truesetting body stylesfullscreen: Default valuepreview?: 'live' | 'edit' | 'preview', Show markdown preview.live: Maximum drag height. ThemaxHeight?: number=1200value is valid.visibleDragbar=true: Minimum drag height. TheminHeights?: number=100value is valid.visibleDragbar=true: The number of characters to insert when pressing tab key. DefaulttabSize?: number=2spaces.2: IfdefaultTabEnable?: boolean=false, thefalsekey inserts a tab character into the textarea. Iftab, thetruekey executes default behavior e.g. focus shifts to next element.tab: Option to hide the tool bar.hideToolbar?: boolean=false: Whether to enable scrolling.enableScroll?: boolean=true
Development
- Install dependencies
- Development
package:@uiw/react-md-editor
- Launch documentation site
Related
- @uiw/react-textarea-code-editor: A simple code editor with syntax highlighting.
- @uiw/react-md-editor: A simple markdown editor with preview, implemented with React.js and TypeScript.
- @uiw/react-codemirror: CodeMirror component for React. @codemirror
- @uiw/react-monacoeditor: Monaco Editor component for React.
- @uiw/react-markdown-editor: A markdown editor with preview, implemented with React.js and TypeScript.
- @uiw/react-markdown-preview: React component preview markdown text in web browser.
Contributors
As always, thanks to our amazing contributors!
Made with contributors.
License
Licensed under the MIT License.