dt
dft-test
npm i dft-test
dt

dft-test

A DraftJS plugin for supporting Markdown syntax shortcuts

by Atsushi NAGASE

0.1.0 (see all)License:MITTypeScript:Not Found
npm i dft-test
Readme

draft-js-markdown-shortcuts-plugin

CircleCI 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

Downloads/wk

1

GitHub Stars

274

LAST COMMIT

2yrs ago

MAINTAINERS

1

CONTRIBUTORS

13

OPEN ISSUES

15

OPEN PRs

3
VersionTagPublished
0.1.0
latest
5yrs ago
No alternatives found
No tutorials found
Add a tutorial