File tree Expand file tree Collapse file tree 3 files changed +70
-4
lines changed Expand file tree Collapse file tree 3 files changed +70
-4
lines changed Original file line number Diff line number Diff line change 11MIT License
22
3- Copyright (c) 2016 Oneteam Inc.
3+ Copyright (c) 2016 Atsushi NAGASE
44
55Permission is hereby granted, free of charge, to any person obtaining a copy
66of this software and associated documentation files (the "Software"), to deal
Original file line number Diff line number Diff line change 1- # draft-js-markdown-shortcuts-plugin
2- A DraftJS plugin for supporting Markdown syntax shortcuts
1+ draft-js-markdown-shortcuts-plugin
2+ ==================================
3+
4+ A [ DraftJS] plugin for supporting Markdown syntax shortcuts
5+
6+ This plugin works with [ DraftJS Plugins] wrapper component.
7+
8+ [ View Demo] [ Demo ]
9+
10+ Usage
11+ -----
12+
13+ ``` sh
14+ npm i --save draft-js-markdown-shortcuts-plugin
15+ ```
16+
17+ then import from your editor component
18+
19+ ``` js
20+ import createMarkdownShortcutsPlugin from ' draft-js-markdown-shortcuts-plugin' ;
21+ ```
22+
23+ Example
24+ -------
25+
26+ ``` js
27+ import React , { Component } from ' react' ;
28+ import Editor from ' draft-js-plugins-editor' ;
29+ import createMarkdownShortcutsPlugin from ' draft-js-markdown-shortcuts-plugin' ;
30+ import { EditorState } from ' draft-js' ;
31+
32+ const plugins = [
33+ createMarkdownShortcutsPlugin ()
34+ ];
35+
36+ export default class DemoEditor extends Component {
37+
38+ state = {
39+ editorState: EditorState .createEmpty (),
40+ };
41+
42+ onChange = (editorState ) => {
43+ this .setState ({
44+ editorState,
45+ });
46+ };
47+
48+ render () {
49+ return (
50+ < Editor
51+ editorState= {this .state .editorState }
52+ onChange= {this .onChange }
53+ plugins= {plugins}
54+ / >
55+ );
56+ }
57+ }
58+ ```
59+
60+ License
61+ -------
62+
63+ MIT. See [ LICENSE]
64+
65+ [ Demo ] : https://ngs.github.io/draft-js-markdown-shortcuts-plugin
66+ [ DraftJS ] : https://facebook.github.io/draft-js/
67+ [ DraftJS Plugins ] : https://github.com/draft-js-plugins/draft-js-plugins
68+ [ LICENSE ] : ./LICENSE
Original file line number Diff line number Diff line change 11{
22 "name" : " draft-js-markdown-shortcuts-plugin" ,
3- "version" : " 1. 0.0" ,
3+ "version" : " 0.0.1 " ,
44 "description" : " A DraftJS plugin for supporting Markdown syntax shortcuts" ,
55 "main" : " lib/index.js" ,
66 "scripts" : {
You can’t perform that action at this time.
0 commit comments