(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(b){var d=/^(\s*)(>[> ]*|- \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,c=/^(\s*)(>[> ]*|- \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,a=/[*+-]\s/;b.commands.newlineAndIndentContinueMarkdownList=function(q){if(q.getOption("disableInput")){return b.Pass}var g=q.listSelections(),k=[];for(var m=0;m<g.length;m++){var p=g[m].head;var h=q.getStateAfter(p.line);var o=h.list!==false;var l=h.quote!==0;var r=q.getLine(p.line),n=d.exec(r);if(!g[m].empty()||(!o&&!l)||!n){q.execCommand("newlineAndIndent");return}if(c.test(r)){q.replaceRange("",{line:p.line,ch:0},{line:p.line,ch:p.ch+1});k[m]="\n"}else{var j=n[1],f=n[5];var e=a.test(n[2])||n[2].indexOf(">")>=0?n[2].replace("x"," "):(parseInt(n[3],10)+1)+n[4];k[m]="\n"+j+e+f}}q.replaceSelections(k)}});