Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ngs/draft-js-markdown-shortcuts-plugin
A DraftJS plugin for supporting Markdown syntax shortcuts
https://github.com/ngs/draft-js-markdown-shortcuts-plugin
draft-js draftjs-plugin markdown
Last synced: 28 days ago
JSON representation
A DraftJS plugin for supporting Markdown syntax shortcuts
- Host: GitHub
- URL: https://github.com/ngs/draft-js-markdown-shortcuts-plugin
- Owner: ngs
- License: mit
- Created: 2016-12-01T07:01:50.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-19T22:04:45.000Z (over 3 years ago)
- Last Synced: 2024-11-10T23:29:37.371Z (about 1 month ago)
- Topics: draft-js, draftjs-plugin, markdown
- Language: JavaScript
- Homepage: https://ngs.github.io/draft-js-markdown-shortcuts-plugin/
- Size: 6.95 MB
- Stars: 275
- Watchers: 6
- Forks: 107
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# draft-js-markdown-shortcuts-plugin
![Run tests](https://github.com/ngs/draft-js-markdown-shortcuts-plugin/workflows/Run%20tests/badge.svg)
[![Backers on Open Collective](https://opencollective.com/draft-js-markdown-shortcuts-plugin/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/draft-js-markdown-shortcuts-plugin/sponsors/badge.svg)](#sponsors) [![npm](https://img.shields.io/npm/v/draft-js-markdown-shortcuts-plugin.svg)][npm]
[![Coverage Status](https://coveralls.io/repos/github/ngs/draft-js-markdown-shortcuts-plugin/badge.svg?branch=master)](https://coveralls.io/github/ngs/draft-js-markdown-shortcuts-plugin?branch=master)A [DraftJS] plugin for supporting Markdown syntax shortcuts
This plugin works with [DraftJS Plugins] wrapper component.
![screen](screen.gif)
[View Demo][demo]
## Usage
```sh
npm i --save draft-js-markdown-shortcuts-plugin
```then import from your editor component
```js
import createMarkdownShortcutsPlugin from 'draft-js-markdown-shortcuts-plugin';
```## Example
```js
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]
[demo]: https://ngs.github.io/draft-js-markdown-shortcuts-plugin
[draftjs]: https://facebook.github.io/draft-js/
[draftjs plugins]: https://github.com/draft-js-plugins/draft-js-plugins
[license]: ./LICENSE
[npm]: https://www.npmjs.com/package/draft-js-markdown-shortcuts-plugin