2 lines
788 B
JavaScript
2 lines
788 B
JavaScript
!function(e,t){"use strict";"object"==typeof module?module.exports=t:"function"==typeof define&&define.amd?define(t):e.AutoList=t}(this,function(e){var t=e.Extension.extend({name:"autolist",init:function(){this.subscribe("editableInput",this.onInput.bind(this))},onInput:function(e){var t=this.base.getSelectedParentElement().textContent;/1\.\s/.test(t)&&this.base.getExtensionByName("orderedlist")?(this.base.execAction("delete"),this.base.execAction("delete"),this.base.execAction("delete"),this.base.execAction("insertorderedlist")):/\*\s/.test(t)&&this.base.getExtensionByName("unorderedlist")&&(this.base.execAction("delete"),this.base.execAction("delete"),this.base.execAction("insertunorderedlist"))}});return t}("function"==typeof require?require("medium-editor"):MediumEditor));
|