+ // Cheeky hack to prevent list toggle action treating tasklists as normal
+ // unordered lists which would unwrap the list on toggle from tasklist to bullet list.
+ // Instead we quickly jump through an ordered list first if we're within a tasklist.
+ if (elementWithinTaskList(editor.selection.getNode())) {
+ editor.execCommand('InsertOrderedList', null, {
+ 'list-item-attributes': {class: null}
+ });
+ }
+