question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Documentation for exact format options to pass into new Quill()?

See original GitHub issue

I’m having trouble finding the exact options to pass into a given format to whitelist, when initializing the first Quill() object.

For example, I know that one would pass into the constructor format options like this:

... = new Quill('#editor', { formats: { script: ..., size: ..., list: .... } })

but what exactly are the individual options that can be passed into each format? Like if the option was color, would we pass in a list of colors in hex values or plain English text (like ‘red’, ‘green’, ‘violet’, etc.)?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

16reactions
bdotzourcommented, Jul 18, 2019

It is a pretty gross oversight in the documentation to not even show an example of this. I had to spend a while with the interactive playground to figure it out. The short answer is that formats is just an array that whitelists the various strings shown on the Formats page. Example:

var quill = new Quill("#editor", {
formats: ['bold', 'italic', 'underline', 'color']
});

This will preserve those formats when pasting in content, but will strip out others (e.g. link, background, etc).

13reactions
ajfarkascommented, Nov 15, 2017

I think this is still an issue. The documentation is of the “finish drawing the owl” variety. I haven’t been able to remove styling from the whitelist. For instance, if I want to prevent people from styling text as “bold”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

API - Quill Rich Text Editor
Quill is a free, open source WYSIWYG editor built for the modern web. Completely customize it for any need with its modular architecture...
Read more >
Build a WYSIWYG text editor using Quill - LogRocket Blog
By the end of this tutorial, you will have a fully functional text editor with text formatting options and full access to the...
Read more >
Using Quill to Build a WYSIWYG Editor [Step-by-Step Tutorial]
Learn to evaluate the best WYSIWYG Editor and then set up and customize ... With Quill, you can easily format text, add images...
Read more >
@peergrade/react-quill - npm
The Quill rich-text editor as a React component.. Latest version: ... you can pass the object through new Delta() again to un-taint it....
Read more >
How do I programatically set QuillJS format settings to "normal ...
This detail seems to be missing from the format call but the answer is the same as the formatText call: pass in false...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found