gtgalone / react-quilljs

React Hook Wrapper for Quill, powerful rich text editor.
https://www.npmjs.com/package/react-quilljs
MIT License
248 stars 28 forks source link

Was code-block feature implemented on react-quilljs? #84

Closed rlynjb closed 4 months ago

rlynjb commented 4 months ago

I have the settings as like this. see below. I'm not sure if I am missing anything else

const toolbarOptions = [
    ['bold', 'italic', 'underline', 'strike'],
    ['blockquote', 'code-block'],
    [{ 'header': 1 }, { 'header': 2 }, { 'header': 3 }, { 'header': 4 }, { 'header': 5 }, { 'header': 6 }],
    [{ 'list': 'ordered'}, { 'list': 'bullet' }],
  ]

  const { quill, quillRef } = useQuill({
    modules: {
      toolbar: toolbarOptions
    },
  });

  useEffect(() => {
    if (quill) {
      quill.clipboard.dangerouslyPasteHTML(desc);
    }
  }, [quill]);