玛氪宕·梦魔(Markdown Memo),使用Markdown的云端备忘录,百度IFE的RIA启航班的不合格的作业,才……才没有什么阴谋呢!
源gitee链接https://gitee.com/arathi/MarkdownMemo?_from=gitee_search
				
			
			
		
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							51 lines
						
					
					
						
							1.7 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							51 lines
						
					
					
						
							1.7 KiB
						
					
					
				
								// CodeMirror, copyright (c) by Marijn Haverbeke and others
							 | 
						|
								// Distributed under an MIT license: http://codemirror.net/LICENSE
							 | 
						|
								
							 | 
						|
								(function(mod) {
							 | 
						|
								  if (typeof exports == "object" && typeof module == "object") // CommonJS
							 | 
						|
								    mod(require("../../lib/codemirror"));
							 | 
						|
								  else if (typeof define == "function" && define.amd) // AMD
							 | 
						|
								    define(["../../lib/codemirror"], mod);
							 | 
						|
								  else // Plain browser env
							 | 
						|
								    mod(CodeMirror);
							 | 
						|
								})(function(CodeMirror) {
							 | 
						|
								  "use strict";
							 | 
						|
								
							 | 
						|
								  var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)\.)(\s*)/,
							 | 
						|
								      emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)\.)(\s*)$/,
							 | 
						|
								      unorderedListRE = /[*+-]\s/;
							 | 
						|
								
							 | 
						|
								  CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
							 | 
						|
								    if (cm.getOption("disableInput")) return CodeMirror.Pass;
							 | 
						|
								    var ranges = cm.listSelections(), replacements = [];
							 | 
						|
								    for (var i = 0; i < ranges.length; i++) {
							 | 
						|
								      var pos = ranges[i].head, match;
							 | 
						|
								      var eolState = cm.getStateAfter(pos.line);
							 | 
						|
								      var inList = eolState.list !== false;
							 | 
						|
								      var inQuote = eolState.quote !== false;
							 | 
						|
								
							 | 
						|
								      if (!ranges[i].empty() || (!inList && !inQuote) || !(match = cm.getLine(pos.line).match(listRE))) {
							 | 
						|
								        cm.execCommand("newlineAndIndent");
							 | 
						|
								        return;
							 | 
						|
								      }
							 | 
						|
								      if (cm.getLine(pos.line).match(emptyListRE)) {
							 | 
						|
								        cm.replaceRange("", {
							 | 
						|
								          line: pos.line, ch: 0
							 | 
						|
								        }, {
							 | 
						|
								          line: pos.line, ch: pos.ch + 1
							 | 
						|
								        });
							 | 
						|
								        replacements[i] = "\n";
							 | 
						|
								
							 | 
						|
								      } else {
							 | 
						|
								        var indent = match[1], after = match[4];
							 | 
						|
								        var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0
							 | 
						|
								          ? match[2]
							 | 
						|
								          : (parseInt(match[3], 10) + 1) + ".";
							 | 
						|
								
							 | 
						|
								        replacements[i] = "\n" + indent + bullet + after;
							 | 
						|
								      }
							 | 
						|
								    }
							 | 
						|
								
							 | 
						|
								    cm.replaceSelections(replacements);
							 | 
						|
								  };
							 | 
						|
								});
							 |