mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Update CodeMirror to version 5.49.0 (#8381)
* Update CodeMirror to version 5.49.0 * Update CodeMirror versions in librejs and VERSIONS
This commit is contained in:
committed by
Lauris BH
parent
6fa14ac3c8
commit
1e9b330525
@@ -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
|
||||
|
||||
/*
|
||||
* =====================================================================================
|
||||
@@ -9,7 +9,7 @@
|
||||
* Description: CodeMirror mode for Asterisk dialplan
|
||||
*
|
||||
* Created: 05/17/2012 09:20:25 PM
|
||||
* Revision: none
|
||||
* Revision: 08/05/2019 AstLinux Project: Support block-comments
|
||||
*
|
||||
* Author: Stas Kobzar (stas@modulis.ca),
|
||||
* Company: Modulis.ca Inc.
|
||||
@@ -67,7 +67,26 @@ CodeMirror.defineMode("asterisk", function() {
|
||||
var cur = '';
|
||||
var ch = stream.next();
|
||||
// comment
|
||||
if (state.blockComment) {
|
||||
if (ch == "-" && stream.match("-;", true)) {
|
||||
state.blockComment = false;
|
||||
} else if (stream.skipTo("--;")) {
|
||||
stream.next();
|
||||
stream.next();
|
||||
stream.next();
|
||||
state.blockComment = false;
|
||||
} else {
|
||||
stream.skipToEnd();
|
||||
}
|
||||
return "comment";
|
||||
}
|
||||
if(ch == ";") {
|
||||
if (stream.match("--", true)) {
|
||||
if (!stream.match("-", false)) { // Except ;--- is not a block comment
|
||||
state.blockComment = true;
|
||||
return "comment";
|
||||
}
|
||||
}
|
||||
stream.skipToEnd();
|
||||
return "comment";
|
||||
}
|
||||
@@ -124,6 +143,7 @@ CodeMirror.defineMode("asterisk", function() {
|
||||
return {
|
||||
startState: function() {
|
||||
return {
|
||||
blockComment: false,
|
||||
extenStart: false,
|
||||
extenSame: false,
|
||||
extenInclude: false,
|
||||
@@ -187,7 +207,11 @@ CodeMirror.defineMode("asterisk", function() {
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
blockCommentStart: ";--",
|
||||
blockCommentEnd: "--;",
|
||||
lineComment: ";"
|
||||
};
|
||||
});
|
||||
|
||||
|
@@ -6,13 +6,14 @@
|
||||
|
||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||
<script src="../../lib/codemirror.js"></script>
|
||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||
<script src="asterisk.js"></script>
|
||||
<style>
|
||||
.CodeMirror {border: 1px solid #999;}
|
||||
.cm-s-default span.cm-arrow { color: red; }
|
||||
</style>
|
||||
<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"></a>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../index.html">Home</a>
|
||||
@@ -145,7 +146,7 @@ exten => 8500,n,Goto(s,6)
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||
mode: "text/x-asterisk",
|
||||
matchBrackets: true,
|
||||
lineNumber: true
|
||||
lineNumbers: true
|
||||
});
|
||||
</script>
|
||||
|
||||
|
Reference in New Issue
Block a user