1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-04 21:15:24 +02:00

CodeMirror dependency upgraded to v5.32.0

For handling Markdown and Code section types
This commit is contained in:
Harvey Kandola 2017-12-18 13:10:51 +00:00
parent 3337db6b27
commit 0336f84a83
351 changed files with 3408 additions and 1945 deletions

0
gui/public/codemirror/mode/apl/apl.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/apl/index.html vendored Executable file → Normal file
View file

1
gui/public/codemirror/mode/asciiarmor/asciiarmor.js vendored Executable file → Normal file
View file

@ -68,6 +68,7 @@
});
CodeMirror.defineMIME("application/pgp", "asciiarmor");
CodeMirror.defineMIME("application/pgp-encrypted", "asciiarmor");
CodeMirror.defineMIME("application/pgp-keys", "asciiarmor");
CodeMirror.defineMIME("application/pgp-signature", "asciiarmor");
});

2
gui/public/codemirror/mode/asciiarmor/index.html vendored Executable file → Normal file
View file

@ -41,6 +41,6 @@ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
</script>
<p><strong>MIME types
defined:</strong> <code>application/pgp</code>, <code>application/pgp-keys</code>, <code>application/pgp-signature</code></p>
defined:</strong> <code>application/pgp</code>, <code>application/pgp-encrypted</code>, <code>application/pgp-keys</code>, <code>application/pgp-signature</code></p>
</article>

0
gui/public/codemirror/mode/asn.1/asn.1.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/asn.1/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/asterisk/asterisk.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/asterisk/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/brainfuck/brainfuck.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/brainfuck/index.html vendored Executable file → Normal file
View file

30
gui/public/codemirror/mode/clike/clike.js vendored Executable file → Normal file
View file

@ -33,7 +33,7 @@ function popContext(state) {
}
function typeBefore(stream, state, pos) {
if (state.prevToken == "variable" || state.prevToken == "variable-3") return true;
if (state.prevToken == "variable" || state.prevToken == "type") return true;
if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true;
if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true;
}
@ -64,7 +64,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
isPunctuationChar = parserConfig.isPunctuationChar || /[\[\]{}\(\),;\:\.]/,
numberStart = parserConfig.numberStart || /[\d\.]/,
number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,
isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/;
isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/,
isIdentifierChar = parserConfig.isIdentifierChar || /[\w\$_\xa1-\uffff]/;
var curPunc, isDefKeyword;
@ -101,9 +102,9 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
while (!stream.match(/^\/[\/*]/, false) && stream.eat(isOperatorChar)) {}
return "operator";
}
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
stream.eatWhile(isIdentifierChar);
if (namespaceSeparator) while (stream.match(namespaceSeparator))
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
stream.eatWhile(isIdentifierChar);
var cur = stream.current();
if (contains(keywords, cur)) {
@ -111,7 +112,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
if (contains(defKeywords, cur)) isDefKeyword = true;
return "keyword";
}
if (contains(types, cur)) return "variable-3";
if (contains(types, cur)) return "type";
if (contains(builtin, cur)) {
if (contains(blockKeywords, cur)) curPunc = "newstatement";
return "builtin";
@ -243,6 +244,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
electricInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{\}?|\})$/ : /^\s*[{}]$/,
blockCommentStart: "/*",
blockCommentEnd: "*/",
blockCommentContinue: " * ",
lineComment: "//",
fold: "brace"
};
@ -280,7 +282,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
}
function pointerHook(_stream, state) {
if (state.prevToken == "variable-3") return "variable-3";
if (state.prevToken == "type") return "type";
return false;
}
@ -314,7 +316,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
}
function cppLooksLikeConstructor(word) {
var lastTwo = /(\w+)::(\w+)$/.exec(word);
var lastTwo = /(\w+)::~?(\w+)$/.exec(word);
return lastTwo && lastTwo[1] == lastTwo[2];
}
@ -390,6 +392,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
typeFirstDefinitions: true,
atoms: words("true false null"),
dontIndentStatements: /^template$/,
isIdentifierChar: /[\w\$_~\xa1-\uffff]/,
hooks: {
"#": cppHook,
"*": pointerHook,
@ -429,7 +432,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
types: words("byte short int long float double boolean char void Boolean Byte Character Double Float " +
"Integer Long Number Object Short String StringBuffer StringBuilder Void"),
blockKeywords: words("catch class do else finally for if switch try while"),
defKeywords: words("class interface package enum @interface"),
defKeywords: words("class interface enum @interface"),
typeFirstDefinitions: true,
atoms: words("true false null"),
number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,
@ -513,8 +516,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
"StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
),
multiLineStrings: true,
blockKeywords: words("catch class do else finally for forSome if match switch try while"),
defKeywords: words("class def object package trait type val var"),
blockKeywords: words("catch class enum do else finally for forSome if match switch try while"),
defKeywords: words("class enum def object package trait type val var"),
atoms: words("true false null"),
indentStatements: false,
indentSwitch: false,
@ -575,7 +578,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
"file import where by get set abstract enum open inner override private public internal " +
"protected catch finally out final vararg reified dynamic companion constructor init " +
"sealed field property receiver param sparam lateinit data inline noinline tailrec " +
"external annotation crossinline const operator infix"
"external annotation crossinline const operator infix suspend"
),
types: words(
/* package java.lang */
@ -587,8 +590,9 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
intendSwitch: false,
indentStatements: false,
multiLineStrings: true,
number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,
blockKeywords: words("catch class do else finally for if where try while enum"),
defKeywords: words("class val var object package interface fun"),
defKeywords: words("class val var object interface fun"),
atoms: words("true false null this"),
hooks: {
'"': function(stream, state) {
@ -771,7 +775,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
return "atom";
},
token: function(_stream, state, style) {
if ((style == "variable" || style == "variable-3") &&
if ((style == "variable" || style == "type") &&
state.prevToken == ".") {
return "variable-2";
}

0
gui/public/codemirror/mode/clike/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/clike/scala.html vendored Executable file → Normal file
View file

16
gui/public/codemirror/mode/clike/test.js vendored Executable file → Normal file
View file

@ -6,8 +6,8 @@
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
MT("indent",
"[variable-3 void] [def foo]([variable-3 void*] [variable a], [variable-3 int] [variable b]) {",
" [variable-3 int] [variable c] [operator =] [variable b] [operator +]",
"[type void] [def foo]([type void*] [variable a], [type int] [variable b]) {",
" [type int] [variable c] [operator =] [variable b] [operator +]",
" [number 1];",
" [keyword return] [operator *][variable a];",
"}");
@ -21,9 +21,9 @@
"}");
MT("def",
"[variable-3 void] [def foo]() {}",
"[type void] [def foo]() {}",
"[keyword struct] [def bar]{}",
"[variable-3 int] [variable-3 *][def baz]() {}");
"[type int] [type *][def baz]() {}");
MT("def_new_line",
"::[variable std]::[variable SomeTerribleType][operator <][variable T][operator >]",
@ -37,10 +37,10 @@
MT("preprocessor",
"[meta #define FOO 3]",
"[variable-3 int] [variable foo];",
"[type int] [variable foo];",
"[meta #define BAR\\]",
"[meta 4]",
"[variable-3 unsigned] [variable-3 int] [variable bar] [operator =] [number 8];",
"[type unsigned] [type int] [variable bar] [operator =] [number 8];",
"[meta #include <baz> ][comment // comment]")
@ -52,4 +52,8 @@
"[number 0b10'000];",
"[number 0x10'000];",
"[string '100000'];");
MTCPP("ctor_dtor",
"[def Foo::Foo]() {}",
"[def Foo::~Foo]() {}");
})();

0
gui/public/codemirror/mode/clojure/clojure.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/clojure/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/cmake/cmake.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/cmake/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/cobol/cobol.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/cobol/index.html vendored Executable file → Normal file
View file

4
gui/public/codemirror/mode/coffeescript/coffeescript.js vendored Executable file → Normal file
View file

@ -349,6 +349,10 @@ CodeMirror.defineMode("coffeescript", function(conf, parserConf) {
return external;
});
// IANA registered media type
// https://www.iana.org/assignments/media-types/
CodeMirror.defineMIME("application/vnd.coffeescript", "coffeescript");
CodeMirror.defineMIME("text/x-coffeescript", "coffeescript");
CodeMirror.defineMIME("text/coffeescript", "coffeescript");

2
gui/public/codemirror/mode/coffeescript/index.html vendored Executable file → Normal file
View file

@ -733,7 +733,7 @@ wrapper::value = -> this._wrapped
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
</script>
<p><strong>MIME types defined:</strong> <code>text/x-coffeescript</code>.</p>
<p><strong>MIME types defined:</strong> <code>application/vnd.coffeescript</code>, <code>text/coffeescript</code>, <code>text/x-coffeescript</code>.</p>
<p>The CoffeeScript mode was written by Jeff Pickhardt.</p>

0
gui/public/codemirror/mode/commonlisp/commonlisp.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/commonlisp/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/crystal/crystal.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/crystal/index.html vendored Executable file → Normal file
View file

21
gui/public/codemirror/mode/css/css.js vendored Executable file → Normal file
View file

@ -383,7 +383,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
style = style[0];
}
override = style;
state.state = states[state.state](type, stream, state);
if (type != "comment")
state.state = states[state.state](type, stream, state);
return override;
},
@ -401,7 +402,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
ch == "{" && (cx.type == "at" || cx.type == "atBlock")) {
// Dedent relative to current context.
indent = Math.max(0, cx.indent - indentUnit);
cx = cx.prev;
}
}
return indent;
@ -410,6 +410,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
electricChars: "}",
blockCommentStart: "/*",
blockCommentEnd: "*/",
blockCommentContinue: " * ",
lineComment: lineComment,
fold: "brace"
};
@ -472,7 +473,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"border-top-left-radius", "border-top-right-radius", "border-top-style",
"border-top-width", "border-width", "bottom", "box-decoration-break",
"box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
"caption-side", "clear", "clip", "color", "color-profile", "column-count",
"caption-side", "caret-color", "clear", "clip", "color", "color-profile", "column-count",
"column-fill", "column-gap", "column-rule", "column-rule-color",
"column-rule-style", "column-rule-width", "column-span", "column-width",
"columns", "content", "counter-increment", "counter-reset", "crop", "cue",
@ -493,7 +494,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns",
"grid-template-rows", "hanging-punctuation", "height", "hyphens",
"icon", "image-orientation", "image-rendering", "image-resolution",
"inline-box-align", "justify-content", "left", "letter-spacing",
"inline-box-align", "justify-content", "justify-items", "justify-self", "left", "letter-spacing",
"line-break", "line-height", "line-stacking", "line-stacking-ruby",
"line-stacking-shift", "line-stacking-strategy", "list-style",
"list-style-image", "list-style-position", "list-style-type", "margin",
@ -508,7 +509,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
"page", "page-break-after", "page-break-before", "page-break-inside",
"page-policy", "pause", "pause-after", "pause-before", "perspective",
"perspective-origin", "pitch", "pitch-range", "play-during", "position",
"perspective-origin", "pitch", "pitch-range", "place-content", "place-items", "place-self", "play-during", "position",
"presentation-level", "punctuation-trim", "quotes", "region-break-after",
"region-break-before", "region-break-inside", "region-fragment",
"rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness",
@ -659,15 +660,15 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
"scroll", "scrollbar", "scroll-position", "se-resize", "searchfield",
"searchfield-cancel-button", "searchfield-decoration",
"searchfield-results-button", "searchfield-results-decoration",
"searchfield-results-button", "searchfield-results-decoration", "self-start", "self-end",
"semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
"simp-chinese-formal", "simp-chinese-informal", "single",
"skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal",
"slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
"small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali",
"source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "spell-out", "square",
"source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "space-evenly", "spell-out", "square",
"square-button", "start", "static", "status-bar", "stretch", "stroke", "sub",
"subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "table",
"subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "system-ui", "table",
"table-caption", "table-cell", "table-column", "table-column-group",
"table-footer-group", "table-header-group", "table-row", "table-row-group",
"tamil",
@ -748,8 +749,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
}
},
":": function(stream) {
if (stream.match(/\s*\{/))
return [null, "{"];
if (stream.match(/\s*\{/, false))
return [null, null]
return false;
},
"$": function(stream) {

0
gui/public/codemirror/mode/css/gss.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/css/gss_test.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/css/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/css/less.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/css/less_test.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/css/scss.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/css/scss_test.js vendored Executable file → Normal file
View file

6
gui/public/codemirror/mode/css/test.js vendored Executable file → Normal file
View file

@ -197,4 +197,10 @@
MT("counter-style-symbols",
"[tag ol] { [property list-style]: [atom symbols]([atom cyclic] [string \"*\"] [string \"\\2020\"] [string \"\\2021\"] [string \"\\A7\"]); }");
MT("comment-does-not-disrupt",
"[def @font-face] [comment /* foo */] {",
" [property src]: [atom url]([string x]);",
" [property font-family]: [variable One];",
"}")
})();

0
gui/public/codemirror/mode/cypher/cypher.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/cypher/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/cypher/test.js vendored Executable file → Normal file
View file

2
gui/public/codemirror/mode/d/d.js vendored Executable file → Normal file
View file

@ -44,7 +44,7 @@ CodeMirror.defineMode("d", function(config, parserConfig) {
}
if (ch == "/") {
if (stream.eat("+")) {
state.tokenize = tokenComment;
state.tokenize = tokenNestedComment;
return tokenNestedComment(stream, state);
}
if (stream.eat("*")) {

0
gui/public/codemirror/mode/d/index.html vendored Executable file → Normal file
View file

11
gui/public/codemirror/mode/d/test.js vendored Normal file
View file

@ -0,0 +1,11 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function() {
var mode = CodeMirror.getMode({indentUnit: 2}, "d");
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
MT("nested_comments",
"[comment /+]","[comment comment]","[comment +/]","[variable void] [variable main](){}");
})();

4
gui/public/codemirror/mode/dart/dart.js vendored Executable file → Normal file
View file

@ -12,8 +12,8 @@
"use strict";
var keywords = ("this super static final const abstract class extends external factory " +
"implements get native operator set typedef with enum throw rethrow " +
"assert break case continue default in return new deferred async await " +
"implements get native set typedef with enum throw rethrow " +
"assert break case continue default in return new deferred async await covariant " +
"try catch finally do else for if switch while import library export " +
"part of show hide is as").split(" ");
var blockKeywords = "try catch finally do else for if switch while".split(" ");

0
gui/public/codemirror/mode/dart/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/diff/diff.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/diff/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/django/django.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/django/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/dtd/dtd.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/dtd/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/dylan/dylan.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/dylan/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/dylan/test.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/ebnf/ebnf.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/ebnf/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/ecl/ecl.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/ecl/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/eiffel/eiffel.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/eiffel/index.html vendored Executable file → Normal file
View file

2
gui/public/codemirror/mode/elm/elm.js vendored Executable file → Normal file
View file

@ -70,7 +70,7 @@
if (smallRE.test(ch)) {
var isDef = source.pos === 1;
source.eatWhile(idRE);
return isDef ? "variable-3" : "variable";
return isDef ? "type" : "variable";
}
if (digitRE.test(ch)) {

0
gui/public/codemirror/mode/elm/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/erlang/erlang.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/erlang/index.html vendored Executable file → Normal file
View file

50
gui/public/codemirror/mode/factor/factor.js vendored Executable file → Normal file
View file

@ -22,52 +22,54 @@
{regex: /#?!.*/, token: "comment"},
// strings """, multiline --> state
{regex: /"""/, token: "string", next: "string3"},
{regex: /"/, token: "string", next: "string"},
{regex: /(STRING:)(\s)/, token: ["keyword", null], next: "string2"},
{regex: /\S*?"/, token: "string", next: "string"},
// numbers: dec, hex, unicode, bin, fractional, complex
{regex: /(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/, token: "number"},
{regex: /(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\-?\d+.?\d*)(?=\s)/, token: "number"},
//{regex: /[+-]?/} //fractional
// definition: defining word, defined word, etc
{regex: /(\:)(\s+)(\S+)(\s+)(\()/, token: ["keyword", null, "def", null, "keyword"], next: "stack"},
{regex: /((?:GENERIC)|\:?\:)(\s+)(\S+)(\s+)(\()/, token: ["keyword", null, "def", null, "bracket"], next: "stack"},
// method definition: defining word, type, defined word, etc
{regex: /(M\:)(\s+)(\S+)(\s+)(\S+)/, token: ["keyword", null, "def", null, "tag"]},
// vocabulary using --> state
{regex: /USING\:/, token: "keyword", next: "vocabulary"},
// vocabulary definition/use
{regex: /(USE\:|IN\:)(\s+)(\S+)/, token: ["keyword", null, "variable-2"]},
// <constructors>
{regex: /<\S+>/, token: "builtin"},
{regex: /(USE\:|IN\:)(\s+)(\S+)(?=\s|$)/, token: ["keyword", null, "tag"]},
// definition: a defining word, defined word
{regex: /(\S+\:)(\s+)(\S+)(?=\s|$)/, token: ["keyword", null, "def"]},
// "keywords", incl. ; t f . [ ] { } defining words
{regex: /;|t|f|if|\.|\[|\]|\{|\}|MAIN:/, token: "keyword"},
{regex: /(?:;|\\|t|f|if|loop|while|until|do|PRIVATE>|<PRIVATE|\.|\S*\[|\]|\S*\{|\})(?=\s|$)/, token: "keyword"},
// <constructors> and the like
{regex: /\S+[\)>\.\*\?]+(?=\s|$)/, token: "builtin"},
{regex: /[\)><]+\S+(?=\s|$)/, token: "builtin"},
// operators
{regex: /(?:[\+\-\=\/\*<>])(?=\s|$)/, token: "keyword"},
// any id (?)
{regex: /\S+/, token: "variable"},
{
regex: /./,
token: null
}
{regex: /\s+|./, token: null}
],
vocabulary: [
{regex: /;/, token: "keyword", next: "start"},
{regex: /\S+/, token: "variable-2"},
{
regex: /./,
token: null
}
{regex: /\S+/, token: "tag"},
{regex: /\s+|./, token: null}
],
string: [
{regex: /(?:[^\\]|\\.)*?"/, token: "string", next: "start"},
{regex: /.*/, token: "string"}
],
string2: [
{regex: /^;/, token: "keyword", next: "start"},
{regex: /.*/, token: "string"}
],
string3: [
{regex: /(?:[^\\]|\\.)*?"""/, token: "string", next: "start"},
{regex: /.*/, token: "string"}
],
stack: [
{regex: /\)/, token: "meta", next: "start"},
{regex: /--/, token: "meta"},
{regex: /\S+/, token: "variable-3"},
{
regex: /./,
token: null
}
{regex: /\)/, token: "bracket", next: "start"},
{regex: /--/, token: "bracket"},
{regex: /\S+/, token: "meta"},
{regex: /\s+|./, token: null}
],
// The meta property contains global information about the mode. It
// can contain properties like lineComment, which are supported by

0
gui/public/codemirror/mode/factor/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/fcl/fcl.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/fcl/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/forth/forth.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/forth/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/fortran/fortran.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/fortran/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/gas/gas.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/gas/index.html vendored Executable file → Normal file
View file

7
gui/public/codemirror/mode/gfm/gfm.js vendored Executable file → Normal file
View file

@ -81,7 +81,7 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) {
if (stream.sol() || state.ateSpace) {
state.ateSpace = false;
if (modeConfig.gitHubSpice !== false) {
if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) {
if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/)) {
// User/Project@SHA
// User@SHA
// SHA
@ -113,10 +113,9 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) {
};
var markdownConfig = {
underscoresBreakWords: false,
taskLists: true,
fencedCodeBlocks: '```',
strikethrough: true
strikethrough: true,
emoji: true
};
for (var attr in modeConfig) {
markdownConfig[attr] = modeConfig[attr];

49
gui/public/codemirror/mode/gfm/index.html vendored Executable file → Normal file
View file

@ -15,7 +15,10 @@
<script src="../htmlmixed/htmlmixed.js"></script>
<script src="../clike/clike.js"></script>
<script src="../meta.js"></script>
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
<style type="text/css">
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
.cm-s-default .cm-emoji {color: #009688;}
</style>
<div id=nav>
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
@ -67,6 +70,10 @@ for (var i = 0; i &lt; items.length; i++) {
## A bit of GitHub spice
See http://github.github.com/github-flavored-markdown/.
(Set `gitHubSpice: false` in mode options to disable):
* SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
* User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
* User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
@ -74,13 +81,21 @@ for (var i = 0; i &lt; items.length; i++) {
* User/#Num: mojombo#1
* User/Project#Num: mojombo/god#1
See http://github.github.com/github-flavored-markdown/.
(Set `emoji: false` in mode options to disable):
* emoji: :smile:
</textarea></form>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
mode: 'gfm',
mode: {
name: "gfm",
tokenTypeOverrides: {
emoji: "emoji"
}
},
lineNumbers: true,
theme: "default"
});
@ -88,6 +103,34 @@ See http://github.github.com/github-flavored-markdown/.
<p>Optionally depends on other modes for properly highlighted code blocks.</p>
<p>Gfm mode supports these options (apart those from base Markdown mode):</p>
<ul>
<li>
<d1>
<dt><code>gitHubSpice: boolean</code></dt>
<dd>Hashes, issues... (default: <code>true</code>).</dd>
</d1>
</li>
<li>
<d1>
<dt><code>taskLists: boolean</code></dt>
<dd><code>- [ ]</code> syntax (default: <code>true</code>).</dd>
</d1>
</li>
<li>
<d1>
<dt><code>strikethrough: boolean</code></dt>
<dd><code>~~foo~~</code> syntax (default: <code>true</code>).</dd>
</d1>
</li>
<li>
<d1>
<dt><code>emoji: boolean</code></dt>
<dd><code>:emoji:</code> syntax (default: <code>true</code>).</dd>
</d1>
</li>
</ul>
<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#gfm_*">normal</a>, <a href="../../test/index.html#verbose,gfm_*">verbose</a>.</p>
</article>

92
gui/public/codemirror/mode/gfm/test.js vendored Executable file → Normal file
View file

@ -2,9 +2,10 @@
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function() {
var mode = CodeMirror.getMode({tabSize: 4}, "gfm");
var config = {tabSize: 4, indentUnit: 2}
var mode = CodeMirror.getMode(config, "gfm");
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "gfm", highlightFormatting: true});
var modeHighlightFormatting = CodeMirror.getMode(config, {name: "gfm", highlightFormatting: true});
function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); }
FT("codeBackticks",
@ -13,11 +14,6 @@
FT("doubleBackticks",
"[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]");
FT("codeBlock",
"[comment&formatting&formatting-code-block ```css]",
"[tag foo]",
"[comment&formatting&formatting-code-block ```]");
FT("taskList",
"[variable-2&formatting&formatting-list&formatting-list-ul - ][meta&formatting&formatting-task [ ]]][variable-2 foo]",
"[variable-2&formatting&formatting-list&formatting-list-ul - ][property&formatting&formatting-task [x]]][variable-2 foo]");
@ -28,6 +24,9 @@
FT("formatting_strikethrough",
"foo [strikethrough&formatting&formatting-strikethrough ~~][strikethrough bar][strikethrough&formatting&formatting-strikethrough ~~]");
FT("formatting_emoji",
"foo [builtin&formatting&formatting-emoji :smile:] foo");
MT("emInWordAsterisk",
"foo[em *bar*]hello");
@ -35,59 +34,31 @@
"foo_bar_hello");
MT("emStrongUnderscore",
"[strong __][em&strong _foo__][em _] bar");
MT("fencedCodeBlocks",
"[comment ```]",
"[comment foo]",
"",
"[comment ```]",
"bar");
MT("fencedCodeBlockModeSwitching",
"[comment ```javascript]",
"[variable foo]",
"",
"[comment ```]",
"bar");
MT("fencedCodeBlockModeSwitchingObjc",
"[comment ```objective-c]",
"[keyword @property] [variable NSString] [operator *] [variable foo];",
"[comment ```]",
"bar");
MT("fencedCodeBlocksNoTildes",
"~~~",
"foo",
"~~~");
"[em&strong ___foo___] bar");
MT("taskListAsterisk",
"[variable-2 * []] foo]", // Invalid; must have space or x between []
"[variable-2 * [ ]]bar]", // Invalid; must have space after ]
"[variable-2 * [x]]hello]", // Invalid; must have space after ]
"[variable-2 * ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links
"[variable-2 * ][link&variable-2 [[]]][variable-2 foo]", // Invalid; must have space or x between []
"[variable-2 * ][link&variable-2 [[ ]]][variable-2 bar]", // Invalid; must have space after ]
"[variable-2 * ][link&variable-2 [[x]]][variable-2 hello]", // Invalid; must have space after ]
"[variable-2 * ][meta [ ]]][variable-2 ][link&variable-2 [[world]]]", // Valid; tests reference style links
" [variable-3 * ][property [x]]][variable-3 foo]"); // Valid; can be nested
MT("taskListPlus",
"[variable-2 + []] foo]", // Invalid; must have space or x between []
"[variable-2 + [ ]]bar]", // Invalid; must have space after ]
"[variable-2 + [x]]hello]", // Invalid; must have space after ]
"[variable-2 + ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links
"[variable-2 + ][link&variable-2 [[]]][variable-2 foo]", // Invalid; must have space or x between []
"[variable-2 + ][link&variable-2 [[x]]][variable-2 hello]", // Invalid; must have space after ]
"[variable-2 + ][meta [ ]]][variable-2 ][link&variable-2 [[world]]]", // Valid; tests reference style links
" [variable-3 + ][property [x]]][variable-3 foo]"); // Valid; can be nested
MT("taskListDash",
"[variable-2 - []] foo]", // Invalid; must have space or x between []
"[variable-2 - [ ]]bar]", // Invalid; must have space after ]
"[variable-2 - [x]]hello]", // Invalid; must have space after ]
"[variable-2 - ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links
"[variable-2 - ][link&variable-2 [[]]][variable-2 foo]", // Invalid; must have space or x between []
"[variable-2 - ][link&variable-2 [[x]]][variable-2 hello]", // Invalid; must have space after ]
"[variable-2 - ][meta [ ]]][variable-2 world]", // Valid; tests reference style links
" [variable-3 - ][property [x]]][variable-3 foo]"); // Valid; can be nested
MT("taskListNumber",
"[variable-2 1. []] foo]", // Invalid; must have space or x between []
"[variable-2 2. [ ]]bar]", // Invalid; must have space after ]
"[variable-2 3. [x]]hello]", // Invalid; must have space after ]
"[variable-2 4. ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links
"[variable-2 1. ][link&variable-2 [[]]][variable-2 foo]", // Invalid; must have space or x between []
"[variable-2 2. ][link&variable-2 [[ ]]][variable-2 bar]", // Invalid; must have space after ]
"[variable-2 3. ][meta [ ]]][variable-2 world]", // Valid; tests reference style links
" [variable-3 1. ][property [x]]][variable-3 foo]"); // Valid; can be nested
MT("SHA",
@ -120,6 +91,9 @@
MT("userProjectSHAEmphasis",
"[em *foo ][em&link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]");
MT("wordSHA",
"ask for feedbac")
MT("num",
"foo [link #1] bar");
@ -165,11 +139,6 @@
MT("notALink",
"foo asfd:asdf bar");
MT("notALink",
"[comment ```css]",
"[tag foo] {[property color]:[keyword black];}",
"[comment ```][link http://www.example.com/]");
MT("notALink",
"[comment ``foo `bar` http://www.example.com/``] hello");
@ -180,17 +149,6 @@
"",
"[link http://www.example.com/]");
MT("headerCodeBlockGithub",
"[header&header-1 # heading]",
"",
"[comment ```]",
"[comment code]",
"[comment ```]",
"",
"Commit: [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2]",
"Issue: [link #1]",
"Link: [link http://www.example.com/]");
MT("strikethrough",
"[strikethrough ~~foo~~]");
@ -233,4 +191,8 @@
MT("strikethroughStrong",
"[strong **][strong&strikethrough ~~foo~~][strong **]");
MT("emoji",
"text [builtin :blush:] text [builtin :v:] text [builtin :+1:] text",
":text text: [builtin :smiley_cat:]");
})();

0
gui/public/codemirror/mode/gherkin/gherkin.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/gherkin/index.html vendored Executable file → Normal file
View file

4
gui/public/codemirror/mode/go/go.js vendored Executable file → Normal file
View file

@ -155,14 +155,14 @@ CodeMirror.defineMode("go", function(config) {
else if (curPunc == "[") pushContext(state, stream.column(), "]");
else if (curPunc == "(") pushContext(state, stream.column(), ")");
else if (curPunc == "case") ctx.type = "case";
else if (curPunc == "}" && ctx.type == "}") ctx = popContext(state);
else if (curPunc == "}" && ctx.type == "}") popContext(state);
else if (curPunc == ctx.type) popContext(state);
state.startOfLine = false;
return style;
},
indent: function(state, textAfter) {
if (state.tokenize != tokenBase && state.tokenize != null) return 0;
if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
if (ctx.type == "case" && /^(?:case|default)\b/.test(textAfter)) {
state.context.type = "}";

0
gui/public/codemirror/mode/go/index.html vendored Executable file → Normal file
View file

4
gui/public/codemirror/mode/groovy/groovy.js vendored Executable file → Normal file
View file

@ -21,9 +21,9 @@ CodeMirror.defineMode("groovy", function(config) {
"abstract as assert boolean break byte case catch char class const continue def default " +
"do double else enum extends final finally float for goto if implements import in " +
"instanceof int interface long native new package private protected public return " +
"short static strictfp super switch synchronized threadsafe throw throws transient " +
"short static strictfp super switch synchronized threadsafe throw throws trait transient " +
"try void volatile while");
var blockKeywords = words("catch class do else finally for if switch try while enum interface def");
var blockKeywords = words("catch class def do else enum finally for if interface switch trait try while");
var standaloneKeywords = words("return break continue");
var atoms = words("null true false this");

0
gui/public/codemirror/mode/groovy/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/haml/haml.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/haml/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/haml/test.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/handlebars/handlebars.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/handlebars/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/haskell-literate/haskell-literate.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/haskell-literate/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/haskell/haskell.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/haskell/index.html vendored Executable file → Normal file
View file

2
gui/public/codemirror/mode/haxe/haxe.js vendored Executable file → Normal file
View file

@ -485,7 +485,7 @@ CodeMirror.defineMode("hxml", function () {
if (state.inString == false && ch == "'") {
state.inString = true;
ch = stream.next();
stream.next();
}
if (state.inString == true) {

0
gui/public/codemirror/mode/haxe/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/htmlembedded/htmlembedded.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/htmlembedded/index.html vendored Executable file → Normal file
View file

4
gui/public/codemirror/mode/htmlmixed/htmlmixed.js vendored Executable file → Normal file
View file

@ -133,11 +133,11 @@
return state.token(stream, state);
},
indent: function (state, textAfter) {
indent: function (state, textAfter, line) {
if (!state.localMode || /^\s*<\//.test(textAfter))
return htmlMode.indent(state.htmlState, textAfter);
else if (state.localMode.indent)
return state.localMode.indent(state.localState, textAfter);
return state.localMode.indent(state.localState, textAfter, line);
else
return CodeMirror.Pass;
},

2
gui/public/codemirror/mode/htmlmixed/index.html vendored Executable file → Normal file
View file

@ -87,7 +87,7 @@
<pre>var myModeSpec = {
name: "htmlmixed",
tags: {
style: [["type", /^text/(x-)?scss$/, "text/x-scss"],
style: [["type", /^text\/(x-)?scss$/, "text/x-scss"],
[null, null, "css"]],
custom: [[null, null, "customMode"]]
}

0
gui/public/codemirror/mode/http/http.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/http/index.html vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/idl/idl.js vendored Executable file → Normal file
View file

0
gui/public/codemirror/mode/idl/index.html vendored Executable file → Normal file
View file

Some files were not shown because too many files have changed in this diff Show more