Skip to content
A DraftJS plugin for supporting Markdown syntax shortcuts
JavaScript Shell
Branch: master
Clone or download
Latest commit 53b91a0 Jul 17, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Publish on tags Jul 17, 2018
demo Add .circleci to demo template Jul 16, 2018
src Add `insertEmptyBlockOnReturnWithModifierKey` config Jul 12, 2018
.babelrc handleImage test Dec 7, 2016
.editorconfig Basic builc environment Dec 2, 2016
.eslintignore
.eslintrc Basic builc environment Dec 2, 2016
.gitignore Use Yarn Feb 1, 2018
.mocha-multi-reporters.json Test coverage Dec 7, 2016
.mocha.opts Update React to 16 + fix tests Feb 1, 2018
.node-version Setup CircleCI 2.0 Jul 16, 2018
.npmignore Add npmignore Dec 6, 2016
.nycrc Tweak config Dec 7, 2016
LICENSE Update README Dec 6, 2016
README.md
package.json Expose demo build script to shell script Jul 17, 2018
screen.gif Add screen animation Dec 11, 2016
testHelper.js
yarn.lock Setup CircleCI 2.0 Jul 16, 2018

README.md

draft-js-markdown-shortcuts-plugin

CircleCI 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 {

  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

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

You can’t perform that action at this time.