Skip to content

Commit

Permalink
Don’t create a list when list format is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
haugstrup committed Jan 10, 2017
1 parent eb7ac6a commit 75b9a37
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions modules/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ Keyboard.DEFAULTS = {
format: { list: false },
prefix: /^(1\.|-)$/,
handler: function(range, context) {
if (this.quill.scroll.whitelist != null && !this.quill.scroll.whitelist['list']) return true;
let length = context.prefix.length;
this.quill.scroll.deleteAt(range.index - length, length);
this.quill.formatLine(range.index - length, 1, 'list', length === 1 ? 'bullet' : 'ordered', Quill.sources.USER);
Expand Down

0 comments on commit 75b9a37

Please sign in to comment.