Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I'd like to use some Quill modules for my own purposes, for example I'd like to use image uploader.
https://github.com/quilljs/quill/blob/9a77567fe356d384074df7479c33ceac509d9351/modules/uploader.js
I'v got access to the quill instance after initialising it:
let quillContainerSelector = '.quill-container';
let quill = new Quill(quillContainerSelector, {
modules: {
toolbar: toolbarOptions
theme: 'snow',
How can I call upload function from Uploader module ?
Create a module which you want use and import to the file where you creating the quill Editor. And before the initiating the quill just register the module you want to use.
Here, I'm using quill in react. Just look into this example you will get an idea.
import Quill from 'quill'
import ReactQuill,{Quill} from 'react-quill';
import MarkdownShortcuts from 'markdownShortCuts';
Quill.register('modules/markdownShortcuts',MarkdownShortcuts)
class Editor extends Component{
constructor (props) {
super(props)
this.state = { editorHtml: '', }
modules = {
markdownShortcuts:{},
render () {
return (
<ReactQuill
modules={this.modules}
value={this.state.editorHtml}
placeholder={this.props.placeholder}
Try like this while registering it will work.
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.