mindroute / quill-autoformat

Module for formatting and transforming text as you type in Quill
MIT License
68 stars 10 forks source link

Using with React-Quill #3

Closed davidwandar closed 5 years ago

davidwandar commented 5 years ago

Trying out quill-autoformat with react-quill, but the editor ends up removing the hashtag I put in. Thoughts on why? Its like it detects it, deletes it, but doesnt put in anything new.

(sigh, cant get my code formatted here, sorry)

editorChange = (value:string, delta: any, source: any, editor: any ) => { this.setState({text: editor.getContents()}) } ... <ReactQuill value={this.state.text} onChange={this.editorChange} formats={[]} modules={{"toolbar": false, autoformat: { hashtag: { trigger: /[\s.,;:!?]/, find: /(?:^|\s)#[^\s.,;:!?]+/i, extract: /#([^\s.,;:!?]+)/i, transform: '$1', insert: 'hashtag'} } }} />

klasjersevi commented 5 years ago

I'll take a look, an update might be needed.

klasjersevi commented 5 years ago

react-quill uses Quill 1.3.4 while this is made for Quill 2.0.0-dev.3.