0.6.1 • Published 4 years ago

draft-js-markdown-shortcuts-plugin v0.6.1

Weekly downloads
3,608
License
MIT
Repository
github
Last release
4 years ago

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);
    state = {
      editorState: EditorState.createEmpty(),
    };
  }

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

  render() {
    return <Editor editorState={this.state.editorState} onChange={this.onChange} plugins={plugins} />;
  }
}

License

MIT. See LICENSE

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.0

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago