forked from ajaxorg/ace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasciidoc.js
32 lines (27 loc) · 921 Bytes
/
asciidoc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var AsciidocHighlightRules = require("./asciidoc_highlight_rules").AsciidocHighlightRules;
var AsciidocFoldMode = require("./folding/asciidoc").FoldMode;
var Mode = function() {
this.HighlightRules = AsciidocHighlightRules;
this.foldingRules = new AsciidocFoldMode();
};
oop.inherits(Mode, TextMode);
(function() {
this.type = "text";
this.getNextLineIndent = function(state, line, tab) {
if (state == "listblock") {
var match = /^((?:.+)?)([-+*][ ]+)/.exec(line);
if (match) {
return new Array(match[1].length + 1).join(" ") + match[2];
} else {
return "";
}
} else {
return this.$getIndent(line);
}
};
this.$id = "ace/mode/asciidoc";
}).call(Mode.prototype);
exports.Mode = Mode;