draft-js-markdown-shortcuts-plugin

by ngs

A DraftJS plugin for supporting Markdown syntax shortcuts

233 Stars 88 Forks Last release: 5 months ago (v0.6.1) MIT License 172 Commits 17 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

draft-js-markdown-shortcuts-plugin

Run tests Backers on Open Collective Sponsors on Open Collective npm Coverage 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

import createMarkdownShortcutsPlugin from 'draft-js-markdown-shortcuts-plugin';

Example

import React, { Component } from 'react';
import Editor from 'draft-js-plugins-editor';
import createMarkdownShortcutsPlugin from 'draft-js-markdown-shortcuts-plugin';
import { EditorState } from 'draft-js';

const plugins = [createMarkdownShortcutsPlugin()];

export default class DemoEditor extends Component { constructor(props) { super(props); this.state = { editorState: EditorState.createEmpty(), }; }

onChange = editorState => { this.setState({ editorState, }); };

render() { return ; } }

License

MIT. See LICENSE

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.