UNPKG

878 BMarkdownView Raw
1
2# Draft Regex
3
4These plugins are written for Draft.js and React to improve TextEditor capabilities.
5
6## In details
7
81. `git clone https://github.com/YozhikM/draft-regex.git`
92. `npm install` *or* `yarn install`
103. `npm start` *or* `yarn start` for demo
114. `npm run build` *or* `yarn build` for build of modules
12
13To use static typing, make sure [that you have installed Flow](https://flow.org/en/docs/install).
14
15## How to use
16
17![Draft Regex](https://i.imgur.com/xzQyZpj.png)
18
19## API
20
21All plugin as an argument are taken by EditorState and options and returned EditorState.
22
23#### `clearEmptyBlock`
24Prevents the ability to add blank lines more than 3 (varies in settings).
25
26#### `replaceTextRegex`
27Apply regular expressions to the entire text, in the process of typing or after copy/pasting text.
28
29#### `clearPastedStyle`
30Clears styles of copy/pasted text to those that you have.