Skip to content
This repository was archived by the owner on Feb 15, 2020. It is now read-only.

Repository files navigation

draft-js-markdown-shortcuts-plugin

CircleCInpmCoverage Status

A DraftJS plugin for supporting Markdown syntax shortcuts

This plugin works with DraftJS Plugins wrapper component.

screen

View Demo

Usage

npm i --save draft-js-markdown-shortcuts-plugin

then import from your editor component

importcreateMarkdownShortcutsPluginfrom'draft-js-markdown-shortcuts-plugin';

Example

importReact,{Component}from'react';importEditorfrom'draft-js-plugins-editor';importcreateMarkdownShortcutsPluginfrom'draft-js-markdown-shortcuts-plugin';import{EditorState}from'draft-js';constplugins=[createMarkdownShortcutsPlugin()];exportdefaultclassDemoEditorextendsComponent{state={editorState: EditorState.createEmpty(),};onChange=(editorState)=>{this.setState({
editorState,});};render(){return(<EditoreditorState={this.state.editorState}onChange={this.onChange}plugins={plugins}/>);}}

License

MIT. See LICENSE

About

A DraftJS plugin for supporting Markdown syntax shortcuts

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages