Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable automatic bullets in Quill

Tags:

quill

Just started using Quill and find it very useful. My projects require plain text editing. Specifically I'm using quill as a form to enter YAML code. The dash, "-", is a key item in YAML. The problem is Quill automatically formats the line as a bullet.

Is there a way to disable automatic bullets?

Kevin

like image 686
K Thorngren Avatar asked Mar 24 '17 20:03

K Thorngren


1 Answers

As mentioned in the comments, whitelist things you'll allow in the "formats" option (not the toolbar area)

var editor = new quill("#someElemId", {
        modules: {
            toolbar: [
                'bold', 
                //{ 'list': 'bullet' }, 
                { 'indent': '-1'}, 
                { 'indent': '+1' }, 
                { 'color': ['black', 'red', 'blue', 'green'] }, 
                'link', 
                'clean'
            ]
        },
        formats : [
            "background",
            "bold", 
            "color", 
            "font", 
            "code", 
            "italic", 
            "link", 
            "size", 
            "strike", 
            "script",
            "underline", 
            "blockquote", 
            // "header",
            "indent", 
            // "list", <-- commented-out to suppress auto bullets
            "align", 
            "direction", 
            "code-block", 
            "formula", 
            "image",
            "video"
        ],
        theme: 'snow', // snow   bubble
    });
like image 151
bob Avatar answered Oct 27 '22 15:10

bob