mirror of
https://github.com/mindoc-org/mindoc.git
synced 2026-02-27 17:03:57 +08:00
upgrade editor.md(many bug exists)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
||||
|
||||
(function(mod) {
|
||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||
@@ -41,10 +41,10 @@
|
||||
state.stringType = stream.peek();
|
||||
stream.next(); // Skip quote
|
||||
state.stack.unshift(stateType._string);
|
||||
} else if (stream.match(/^\/\*/)) { //comments starting with /*
|
||||
} else if (stream.match('/*')) { //comments starting with /*
|
||||
state.stack.unshift(stateType.comment);
|
||||
state.commentType = commentType.slash;
|
||||
} else if (stream.match(/^\(\*/)) { //comments starting with (*
|
||||
} else if (stream.match('(*')) { //comments starting with (*
|
||||
state.stack.unshift(stateType.comment);
|
||||
state.commentType = commentType.parenthesis;
|
||||
}
|
||||
@@ -69,10 +69,10 @@
|
||||
|
||||
case stateType.comment:
|
||||
while (state.stack[0] === stateType.comment && !stream.eol()) {
|
||||
if (state.commentType === commentType.slash && stream.match(/\*\//)) {
|
||||
if (state.commentType === commentType.slash && stream.match('*/')) {
|
||||
state.stack.shift(); // Clear flag
|
||||
state.commentType = null;
|
||||
} else if (state.commentType === commentType.parenthesis && stream.match(/\*\)/)) {
|
||||
} else if (state.commentType === commentType.parenthesis && stream.match('*)')) {
|
||||
state.stack.shift(); // Clear flag
|
||||
state.commentType = null;
|
||||
} else {
|
||||
@@ -83,7 +83,7 @@
|
||||
|
||||
case stateType.characterClass:
|
||||
while (state.stack[0] === stateType.characterClass && !stream.eol()) {
|
||||
if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) {
|
||||
if (!(stream.match(/^[^\]\\]+/) || stream.match('.'))) {
|
||||
state.stack.shift();
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@
|
||||
|
||||
if (bracesMode !== null && (state.braced || peek === "{")) {
|
||||
if (state.localState === null)
|
||||
state.localState = bracesMode.startState();
|
||||
state.localState = CodeMirror.startState(bracesMode);
|
||||
|
||||
var token = bracesMode.token(stream, state.localState),
|
||||
text = stream.current();
|
||||
@@ -168,10 +168,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (stream.match(/^\/\//)) {
|
||||
if (stream.match('//')) {
|
||||
stream.skipToEnd();
|
||||
return "comment";
|
||||
} else if (stream.match(/return/)) {
|
||||
} else if (stream.match('return')) {
|
||||
return "operator";
|
||||
} else if (stream.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)) {
|
||||
if (stream.match(/(?=[\(.])/)) {
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
<script src="../../lib/codemirror.js"></script>
|
||||
<script src="../javascript/javascript.js"></script>
|
||||
<script src="ebnf.js"></script>
|
||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id=nav>
|
||||
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../index.html">Home</a>
|
||||
|
||||
Reference in New Issue
Block a user