erp_app 3.0.10 → 3.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/erp_app/version.rb +1 -1
- data/public/javascripts/erp_app/codemirror/README.md +1 -1
- data/public/javascripts/erp_app/codemirror/doc/compress.html +11 -3
- data/public/javascripts/erp_app/codemirror/doc/docs.css +16 -5
- data/public/javascripts/erp_app/codemirror/doc/internals.html +6 -3
- data/public/javascripts/erp_app/codemirror/doc/manual.html +103 -41
- data/public/javascripts/erp_app/codemirror/doc/oldrelease.html +43 -5
- data/public/javascripts/erp_app/codemirror/doc/reporting.html +6 -3
- data/public/javascripts/erp_app/codemirror/doc/upgrade_v2.2.html +7 -4
- data/public/javascripts/erp_app/codemirror/keymap/vim.js +10 -6
- data/public/javascripts/erp_app/codemirror/lib/codemirror.css +16 -12
- data/public/javascripts/erp_app/codemirror/lib/codemirror.js +699 -787
- data/public/javascripts/erp_app/codemirror/lib/util/closetag.js +35 -35
- data/public/javascripts/erp_app/codemirror/lib/util/dialog.js +4 -1
- data/public/javascripts/erp_app/codemirror/lib/util/formatting.js +147 -253
- data/public/javascripts/erp_app/codemirror/lib/util/javascript-hint.js +3 -3
- data/public/javascripts/erp_app/codemirror/lib/util/loadmode.js +1 -1
- data/public/javascripts/erp_app/codemirror/lib/util/multiplex.js +5 -9
- data/public/javascripts/erp_app/codemirror/lib/util/overlay.js +3 -1
- data/public/javascripts/erp_app/codemirror/lib/util/pig-hint.js +1 -1
- data/public/javascripts/erp_app/codemirror/lib/util/runmode-standalone.js +90 -0
- data/public/javascripts/erp_app/codemirror/lib/util/runmode.js +8 -4
- data/public/javascripts/erp_app/codemirror/lib/util/search.js +4 -4
- data/public/javascripts/erp_app/codemirror/lib/util/searchcursor.js +13 -11
- data/public/javascripts/erp_app/codemirror/lib/util/simple-hint.js +89 -68
- data/public/javascripts/erp_app/codemirror/lib/util/xml-hint.js +8 -8
- data/public/javascripts/erp_app/codemirror/mode/clike/clike.js +6 -2
- data/public/javascripts/erp_app/codemirror/mode/clike/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/clike/scala.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/clojure/clojure.js +8 -9
- data/public/javascripts/erp_app/codemirror/mode/clojure/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/coffeescript/coffeescript.js +3 -3
- data/public/javascripts/erp_app/codemirror/mode/coffeescript/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/commonlisp/commonlisp.js +101 -0
- data/public/javascripts/erp_app/codemirror/mode/commonlisp/index.html +165 -0
- data/public/javascripts/erp_app/codemirror/mode/css/css.js +339 -15
- data/public/javascripts/erp_app/codemirror/mode/css/index.html +3 -0
- data/public/javascripts/erp_app/codemirror/mode/css/test.js +501 -0
- data/public/javascripts/erp_app/codemirror/mode/diff/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/ecl/ecl.js +1 -1
- data/public/javascripts/erp_app/codemirror/mode/erlang/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/gfm/gfm.js +10 -4
- data/public/javascripts/erp_app/codemirror/mode/gfm/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/go/go.js +2 -2
- data/public/javascripts/erp_app/codemirror/mode/go/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/groovy/groovy.js +1 -1
- data/public/javascripts/erp_app/codemirror/mode/groovy/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/haskell/haskell.js +2 -2
- data/public/javascripts/erp_app/codemirror/mode/haskell/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/haxe/haxe.js +4 -7
- data/public/javascripts/erp_app/codemirror/mode/haxe/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/htmlembedded/htmlembedded.js +8 -4
- data/public/javascripts/erp_app/codemirror/mode/htmlembedded/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/htmlmixed/htmlmixed.js +12 -13
- data/public/javascripts/erp_app/codemirror/mode/htmlmixed/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/javascript/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/javascript/javascript.js +3 -3
- data/public/javascripts/erp_app/codemirror/mode/jinja2/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/less/index.html +124 -2
- data/public/javascripts/erp_app/codemirror/mode/less/less.js +94 -60
- data/public/javascripts/erp_app/codemirror/mode/lua/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/markdown/index.html +3 -0
- data/public/javascripts/erp_app/codemirror/mode/markdown/markdown.js +134 -20
- data/public/javascripts/erp_app/codemirror/mode/markdown/test.js +1084 -0
- data/public/javascripts/erp_app/codemirror/mode/mysql/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/ntriples/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/ntriples/ntriples.js +4 -4
- data/public/javascripts/erp_app/codemirror/mode/ocaml/ocaml.js +1 -1
- data/public/javascripts/erp_app/codemirror/mode/pascal/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/pascal/pascal.js +1 -1
- data/public/javascripts/erp_app/codemirror/mode/perl/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/perl/perl.js +71 -71
- data/public/javascripts/erp_app/codemirror/mode/php/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/php/php.js +7 -9
- data/public/javascripts/erp_app/codemirror/mode/pig/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/pig/pig.js +3 -3
- data/public/javascripts/erp_app/codemirror/mode/plsql/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/properties/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/python/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/python/python.js +1 -1
- data/public/javascripts/erp_app/codemirror/mode/r/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/rpm/changes/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/rpm/spec/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/rst/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/ruby/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/rust/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/scheme/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/scheme/scheme.js +1 -1
- data/public/javascripts/erp_app/codemirror/mode/shell/shell.js +2 -2
- data/public/javascripts/erp_app/codemirror/mode/sieve/LICENSE +23 -0
- data/public/javascripts/erp_app/codemirror/mode/sieve/index.html +81 -0
- data/public/javascripts/erp_app/codemirror/mode/sieve/sieve.js +156 -0
- data/public/javascripts/erp_app/codemirror/mode/smalltalk/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/smalltalk/smalltalk.js +2 -2
- data/public/javascripts/erp_app/codemirror/mode/smarty/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/smarty/smarty.js +2 -2
- data/public/javascripts/erp_app/codemirror/mode/sparql/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/stex/index.html +3 -0
- data/public/javascripts/erp_app/codemirror/mode/stex/stex.js +1 -1
- data/public/javascripts/erp_app/codemirror/mode/stex/test.js +343 -0
- data/public/javascripts/erp_app/codemirror/mode/tiddlywiki/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/tiki/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/tiki/tiki.js +4 -11
- data/public/javascripts/erp_app/codemirror/mode/vb/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/vb/vb.js +2 -2
- data/public/javascripts/erp_app/codemirror/mode/vbscript/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/velocity/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/velocity/velocity.js +1 -1
- data/public/javascripts/erp_app/codemirror/mode/verilog/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/mode/verilog/verilog.js +1 -1
- data/public/javascripts/erp_app/codemirror/mode/xml/index.html +2 -1
- data/public/javascripts/erp_app/codemirror/mode/xml/xml.js +2 -10
- data/public/javascripts/erp_app/codemirror/mode/xquery/index.html +3 -2
- data/public/javascripts/erp_app/codemirror/mode/xquery/xquery.js +7 -4
- data/public/javascripts/erp_app/codemirror/mode/yaml/index.html +1 -0
- data/public/javascripts/erp_app/codemirror/package.json +15 -23
- data/public/javascripts/erp_app/codemirror/test/driver.js +109 -22
- data/public/javascripts/erp_app/codemirror/test/index.html +129 -16
- data/public/javascripts/erp_app/codemirror/test/lint/lint.js +120 -0
- data/public/javascripts/erp_app/codemirror/test/lint/parse-js.js +1372 -0
- data/public/javascripts/erp_app/codemirror/test/mode_test.css +0 -12
- data/public/javascripts/erp_app/codemirror/test/mode_test.js +66 -27
- data/public/javascripts/erp_app/codemirror/test/phantom_driver.js +30 -0
- data/public/javascripts/erp_app/codemirror/test/run.js +32 -0
- data/public/javascripts/erp_app/codemirror/test/test.js +213 -8
- data/public/javascripts/erp_app/shared/dynamic_editable_grid.js +33 -27
- data/public/javascripts/erp_app/shared/dynamic_editable_grid_loader_panel.js +2 -1
- metadata +15 -3
- data/public/javascripts/erp_app/codemirror/mode/stex/test.html +0 -263
@@ -1,6 +1,7 @@
|
|
1
1
|
<!doctype html>
|
2
2
|
<html>
|
3
3
|
<head>
|
4
|
+
<meta charset="utf-8">
|
4
5
|
<title>CodeMirror: Markdown mode</title>
|
5
6
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
6
7
|
<script src="../../lib/codemirror.js"></script>
|
@@ -336,5 +337,7 @@ Output:
|
|
336
337
|
|
337
338
|
<p><strong>MIME types defined:</strong> <code>text/x-markdown</code>.</p>
|
338
339
|
|
340
|
+
<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#markdown_*">normal</a>, <a href="../../test/index.html#verbose,markdown_*">verbose</a>.</p>
|
341
|
+
|
339
342
|
</body>
|
340
343
|
</html>
|
@@ -2,12 +2,18 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|
2
2
|
|
3
3
|
var htmlFound = CodeMirror.mimeModes.hasOwnProperty("text/html");
|
4
4
|
var htmlMode = CodeMirror.getMode(cmCfg, htmlFound ? "text/html" : "text/plain");
|
5
|
+
|
6
|
+
var codeDepth = 0;
|
7
|
+
var prevLineHasContent = false
|
8
|
+
, thisLineHasContent = false;
|
5
9
|
|
6
10
|
var header = 'header'
|
7
11
|
, code = 'comment'
|
8
12
|
, quote = 'quote'
|
9
13
|
, list = 'string'
|
10
14
|
, hr = 'hr'
|
15
|
+
, linkinline = 'link'
|
16
|
+
, linkemail = 'link'
|
11
17
|
, linktext = 'link'
|
12
18
|
, linkhref = 'string'
|
13
19
|
, em = 'em'
|
@@ -17,8 +23,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|
17
23
|
var hrRE = /^([*\-=_])(?:\s*\1){2,}\s*$/
|
18
24
|
, ulRE = /^[*\-+]\s+/
|
19
25
|
, olRE = /^[0-9]+\.\s+/
|
20
|
-
, headerRE = /^(?:\={
|
21
|
-
, textRE = /^[^\[*_\\<>`]+/;
|
26
|
+
, headerRE = /^(?:\={1,}|-{1,})$/
|
27
|
+
, textRE = /^[^\[*_\\<>` "'(]+/;
|
22
28
|
|
23
29
|
function switchInline(stream, state, f) {
|
24
30
|
state.f = state.inline = f;
|
@@ -34,10 +40,16 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|
34
40
|
// Blocks
|
35
41
|
|
36
42
|
function blankLine(state) {
|
43
|
+
// Reset linkTitle state
|
44
|
+
state.linkTitle = false;
|
45
|
+
// Reset CODE state
|
46
|
+
state.code = false;
|
37
47
|
// Reset EM state
|
38
48
|
state.em = false;
|
39
49
|
// Reset STRONG state
|
40
50
|
state.strong = false;
|
51
|
+
// Reset state.quote
|
52
|
+
state.quote = false;
|
41
53
|
if (!htmlFound && state.f == htmlBlock) {
|
42
54
|
state.f = inlineNormal;
|
43
55
|
state.block = blockNormal;
|
@@ -47,13 +59,23 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|
47
59
|
|
48
60
|
function blockNormal(stream, state) {
|
49
61
|
var match;
|
62
|
+
|
63
|
+
if (state.list !== false && state.indentationDiff >= 0) { // Continued list
|
64
|
+
if (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block
|
65
|
+
state.indentation -= state.indentationDiff;
|
66
|
+
}
|
67
|
+
state.list = null;
|
68
|
+
} else { // No longer a list
|
69
|
+
state.list = false;
|
70
|
+
}
|
71
|
+
|
50
72
|
if (state.indentationDiff >= 4) {
|
51
|
-
state.indentation -=
|
73
|
+
state.indentation -= 4;
|
52
74
|
stream.skipToEnd();
|
53
75
|
return code;
|
54
76
|
} else if (stream.eatSpace()) {
|
55
77
|
return null;
|
56
|
-
} else if (stream.peek() === '#' || stream.match(headerRE)) {
|
78
|
+
} else if (stream.peek() === '#' || (prevLineHasContent && stream.match(headerRE)) ) {
|
57
79
|
state.header = true;
|
58
80
|
} else if (stream.eat('>')) {
|
59
81
|
state.indentation++;
|
@@ -63,8 +85,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|
63
85
|
} else if (stream.match(hrRE, true)) {
|
64
86
|
return hr;
|
65
87
|
} else if (match = stream.match(ulRE, true) || stream.match(olRE, true)) {
|
66
|
-
state.indentation +=
|
67
|
-
|
88
|
+
state.indentation += 4;
|
89
|
+
state.list = true;
|
68
90
|
}
|
69
91
|
|
70
92
|
return switchInline(stream, state, state.inline);
|
@@ -92,8 +114,11 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|
92
114
|
if (state.strong) { styles.push(state.em ? emstrong : strong); }
|
93
115
|
else if (state.em) { styles.push(em); }
|
94
116
|
|
117
|
+
if (state.code) { styles.push(code); }
|
118
|
+
|
95
119
|
if (state.header) { styles.push(header); }
|
96
120
|
if (state.quote) { styles.push(quote); }
|
121
|
+
if (state.list !== false) { styles.push(list); }
|
97
122
|
|
98
123
|
return styles.length ? styles.join(' ') : null;
|
99
124
|
}
|
@@ -106,22 +131,68 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|
106
131
|
}
|
107
132
|
|
108
133
|
function inlineNormal(stream, state) {
|
109
|
-
var style = state.text(stream, state)
|
134
|
+
var style = state.text(stream, state);
|
110
135
|
if (typeof style !== 'undefined')
|
111
136
|
return style;
|
112
137
|
|
138
|
+
if (state.list) { // List marker (*, +, -, 1., etc)
|
139
|
+
state.list = null;
|
140
|
+
return list;
|
141
|
+
}
|
142
|
+
|
113
143
|
var ch = stream.next();
|
114
144
|
|
115
145
|
if (ch === '\\') {
|
116
146
|
stream.next();
|
117
147
|
return getType(state);
|
118
148
|
}
|
149
|
+
|
150
|
+
// Matches link titles present on next line
|
151
|
+
if (state.linkTitle) {
|
152
|
+
state.linkTitle = false;
|
153
|
+
var matchCh = ch;
|
154
|
+
if (ch === '(') {
|
155
|
+
matchCh = ')';
|
156
|
+
}
|
157
|
+
matchCh = (matchCh+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
|
158
|
+
var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh;
|
159
|
+
if (stream.match(new RegExp(regex), true)) {
|
160
|
+
return linkhref;
|
161
|
+
}
|
162
|
+
}
|
163
|
+
|
119
164
|
if (ch === '`') {
|
120
|
-
|
165
|
+
var t = getType(state);
|
166
|
+
var before = stream.pos;
|
167
|
+
stream.eatWhile('`');
|
168
|
+
var difference = 1 + stream.pos - before;
|
169
|
+
if (!state.code) {
|
170
|
+
codeDepth = difference;
|
171
|
+
state.code = true;
|
172
|
+
return getType(state);
|
173
|
+
} else {
|
174
|
+
if (difference === codeDepth) { // Must be exact
|
175
|
+
state.code = false;
|
176
|
+
return t;
|
177
|
+
}
|
178
|
+
return getType(state);
|
179
|
+
}
|
180
|
+
} else if (state.code) {
|
181
|
+
return getType(state);
|
121
182
|
}
|
122
|
-
|
183
|
+
|
184
|
+
if (ch === '[' && stream.match(/.*\] ?(?:\(|\[)/, false)) {
|
123
185
|
return switchInline(stream, state, linkText);
|
124
186
|
}
|
187
|
+
|
188
|
+
if (ch === '<' && stream.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/, true)) {
|
189
|
+
return switchInline(stream, state, inlineElement(linkinline, '>'));
|
190
|
+
}
|
191
|
+
|
192
|
+
if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, true)) {
|
193
|
+
return switchInline(stream, state, inlineElement(linkemail, '>'));
|
194
|
+
}
|
195
|
+
|
125
196
|
if (ch === '<' && stream.match(/^\w/, false)) {
|
126
197
|
var md_inside = false;
|
127
198
|
if (stream.string.indexOf(">")!=-1) {
|
@@ -141,10 +212,27 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|
141
212
|
|
142
213
|
var t = getType(state);
|
143
214
|
if (ch === '*' || ch === '_') {
|
144
|
-
if (stream.eat(ch)) {
|
145
|
-
|
215
|
+
if (state.strong === ch && stream.eat(ch)) { // Remove STRONG
|
216
|
+
state.strong = false;
|
217
|
+
return t;
|
218
|
+
} else if (!state.strong && stream.eat(ch)) { // Add STRONG
|
219
|
+
state.strong = ch;
|
220
|
+
return getType(state);
|
221
|
+
} else if (state.em === ch) { // Remove EM
|
222
|
+
state.em = false;
|
223
|
+
return t;
|
224
|
+
} else if (!state.em) { // Add EM
|
225
|
+
state.em = ch;
|
226
|
+
return getType(state);
|
227
|
+
}
|
228
|
+
} else if (ch === ' ') {
|
229
|
+
if (stream.eat('*') || stream.eat('_')) { // Probably surrounded by spaces
|
230
|
+
if (stream.peek() === ' ') { // Surrounded by spaces, ignore
|
231
|
+
return getType(state);
|
232
|
+
} else { // Not surrounded by spaces, back up pointer
|
233
|
+
stream.backUp(1);
|
234
|
+
}
|
146
235
|
}
|
147
|
-
return (state.em = !state.em) ? getType(state) : t;
|
148
236
|
}
|
149
237
|
|
150
238
|
return getType(state);
|
@@ -163,7 +251,10 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|
163
251
|
}
|
164
252
|
|
165
253
|
function linkHref(stream, state) {
|
166
|
-
|
254
|
+
// Check if space, and return NULL if so (to avoid marking the space)
|
255
|
+
if(stream.eatSpace()){
|
256
|
+
return null;
|
257
|
+
}
|
167
258
|
var ch = stream.next();
|
168
259
|
if (ch === '(' || ch === '[') {
|
169
260
|
return switchInline(stream, state, inlineElement(linkhref, ch === '(' ? ')' : ']'));
|
@@ -180,17 +271,29 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|
180
271
|
}
|
181
272
|
|
182
273
|
function footnoteUrl(stream, state) {
|
183
|
-
|
274
|
+
// Check if space, and return NULL if so (to avoid marking the space)
|
275
|
+
if(stream.eatSpace()){
|
276
|
+
return null;
|
277
|
+
}
|
278
|
+
// Match URL
|
184
279
|
stream.match(/^[^\s]+/, true);
|
280
|
+
// Check for link title
|
281
|
+
if (stream.peek() === undefined) { // End of line, set flag to check next line
|
282
|
+
state.linkTitle = true;
|
283
|
+
} else { // More content on line, check if link title
|
284
|
+
stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true);
|
285
|
+
}
|
185
286
|
state.f = state.inline = inlineNormal;
|
186
287
|
return linkhref;
|
187
288
|
}
|
188
289
|
|
189
290
|
function inlineRE(endChar) {
|
190
291
|
if (!inlineRE[endChar]) {
|
191
|
-
//
|
192
|
-
|
193
|
-
|
292
|
+
// Escape endChar for RegExp (taken from http://stackoverflow.com/a/494122/526741)
|
293
|
+
endChar = (endChar+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
|
294
|
+
// Match any non-endChar, escaped character, as well as the closing
|
295
|
+
// endChar.
|
296
|
+
inlineRE[endChar] = new RegExp('^(?:[^\\\\]+?|\\\\.)*?(' + endChar + ')');
|
194
297
|
}
|
195
298
|
return inlineRE[endChar];
|
196
299
|
}
|
@@ -215,9 +318,11 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|
215
318
|
|
216
319
|
inline: inlineNormal,
|
217
320
|
text: handleText,
|
321
|
+
linkTitle: false,
|
218
322
|
em: false,
|
219
323
|
strong: false,
|
220
324
|
header: false,
|
325
|
+
list: false,
|
221
326
|
quote: false
|
222
327
|
};
|
223
328
|
},
|
@@ -232,9 +337,11 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|
232
337
|
|
233
338
|
inline: s.inline,
|
234
339
|
text: s.text,
|
340
|
+
linkTitle: s.linkTitle,
|
235
341
|
em: s.em,
|
236
342
|
strong: s.strong,
|
237
343
|
header: s.header,
|
344
|
+
list: s.list,
|
238
345
|
quote: s.quote,
|
239
346
|
md_inside: s.md_inside
|
240
347
|
};
|
@@ -242,12 +349,19 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|
242
349
|
|
243
350
|
token: function(stream, state) {
|
244
351
|
if (stream.sol()) {
|
245
|
-
if (stream.match(/^\s*$/, true)) {
|
352
|
+
if (stream.match(/^\s*$/, true)) {
|
353
|
+
prevLineHasContent = false;
|
354
|
+
return blankLine(state);
|
355
|
+
} else {
|
356
|
+
if(thisLineHasContent){
|
357
|
+
prevLineHasContent = true;
|
358
|
+
thisLineHasContent = false;
|
359
|
+
}
|
360
|
+
thisLineHasContent = true;
|
361
|
+
}
|
246
362
|
|
247
363
|
// Reset state.header
|
248
364
|
state.header = false;
|
249
|
-
// Reset state.quote
|
250
|
-
state.quote = false;
|
251
365
|
|
252
366
|
state.f = state.block;
|
253
367
|
var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, ' ').length;
|