From 5c4daf354df7c3de38518244dac6fb2505c339ab Mon Sep 17 00:00:00 2001 From: mkslanc Date: Fri, 9 Sep 2022 18:35:49 +0400 Subject: [PATCH 01/45] experiment: introduce scopes (for custom tokenizer) --- demo/kitchen-sink/token_tooltip.js | 30 +++- src/background_tokenizer.js | 7 +- src/edit_session/bracket_match.js | 4 +- src/edit_session/folding.js | 4 +- src/editor.js | 2 +- src/ext/beautify.js | 4 +- src/layer/text.js | 6 +- src/mode/_test/highlight_rules_test.js | 4 +- src/mode/text.js | 33 ++++- src/mode/text_highlight_rules.js | 10 +- src/scope.js | 44 ++++++ src/tokenizer.js | 191 +++++++++++++++++++++++++ src/tooltip.js | 6 +- 13 files changed, 317 insertions(+), 28 deletions(-) create mode 100644 src/scope.js diff --git a/demo/kitchen-sink/token_tooltip.js b/demo/kitchen-sink/token_tooltip.js index d3260bf33c6..705706fc816 100644 --- a/demo/kitchen-sink/token_tooltip.js +++ b/demo/kitchen-sink/token_tooltip.js @@ -60,13 +60,23 @@ oop.inherits(TokenTooltip, Tooltip); return; } - var tokenText = token.type; - if (token.state) - tokenText += "|" + token.state; - if (token.merge) - tokenText += "\n merge"; - if (token.stateTransitions) - tokenText += "\n " + token.stateTransitions.join("\n "); + var tokenText = ""; + var scope = token.type; + if (scope.name !== undefined) { + do { + tokenText += scope.name + "\n" + if (!scope.parent) + tokenText += "\ntoken count:" + count(scope); + } while(scope = scope.parent) + } else { + tokenText += token.type; + if (token.state) + tokenText += "|" + token.state; + if (token.merge) + tokenText += "\n merge"; + if (token.stateTransitions) + tokenText += "\n " + token.stateTransitions.join("\n "); + } if (this.tokenText != tokenText) { this.setText(tokenText); @@ -120,4 +130,10 @@ oop.inherits(TokenTooltip, Tooltip); }).call(TokenTooltip.prototype); +function count(root) { + return Object.keys(root.children).reduce(function (n, key) { + return n + count(root.children[key]); + }, 1); +} + exports.TokenTooltip = TokenTooltip; diff --git a/src/background_tokenizer.js b/src/background_tokenizer.js index f8064bf287b..2120248d003 100644 --- a/src/background_tokenizer.js +++ b/src/background_tokenizer.js @@ -195,9 +195,12 @@ var BackgroundTokenizer = function(tokenizer, editor) { var state = this.states[row - 1]; var data = this.tokenizer.getLineTokens(line, state, row); + var lastToken = data.tokens[data.tokens.length - 1]; + var newState = (lastToken !== undefined && lastToken.type !== undefined && lastToken.type.parent !== undefined) + ? lastToken.type.parent : data.state; - if (this.states[row] + "" !== data.state + "") { - this.states[row] = data.state; + if (this.states[row] !== newState) { + this.states[row] = newState; this.lines[row + 1] = null; if (this.currentLine > row + 1) this.currentLine = row + 1; diff --git a/src/edit_session/bracket_match.js b/src/edit_session/bracket_match.js index 9544f5dc12b..ae451ba7b36 100644 --- a/src/edit_session/bracket_match.js +++ b/src/edit_session/bracket_match.js @@ -151,7 +151,7 @@ function BracketMatch() { // whose type matches typeRe do { token = iterator.stepBackward(); - } while (token && !typeRe.test(token.type)); + } while (token && !typeRe.test(token.type.toString())); if (token == null) break; @@ -209,7 +209,7 @@ function BracketMatch() { // whose type matches typeRe do { token = iterator.stepForward(); - } while (token && !typeRe.test(token.type)); + } while (token && !typeRe.test(token.type.toString())); if (token == null) break; diff --git a/src/edit_session/folding.js b/src/edit_session/folding.js index 6ff8d9edeb8..d765a2a0105 100644 --- a/src/edit_session/folding.js +++ b/src/edit_session/folding.js @@ -585,9 +585,9 @@ function Folding() { var token = iterator.getCurrentToken(); var type = token && token.type; if (token && /^comment|string/.test(type)) { - type = type.match(/comment|string/)[0]; + type = /comment|string/.exec(type)[0]; if (type == "comment") - type += "|doc-start"; + type += "|doc-start|empty"; var re = new RegExp(type); var range = new Range(); if (dir != 1) { diff --git a/src/editor.js b/src/editor.js index 887b9fcbce0..a08632d8952 100644 --- a/src/editor.js +++ b/src/editor.js @@ -557,7 +557,7 @@ Editor.$uid = 0; var iterator = new TokenIterator(self.session, pos.row, pos.column); var token = iterator.getCurrentToken(); - if (!token || !/\b(?:tag-open|tag-name)/.test(token.type)) { + if (!token || !/\b(?:tag-open|tag-name)/.test(token.type.toString())) { session.removeMarker(session.$tagHighlight); session.$tagHighlight = null; return; diff --git a/src/ext/beautify.js b/src/ext/beautify.js index 10e7548bf00..6a787ecc77d 100644 --- a/src/ext/beautify.js +++ b/src/ext/beautify.js @@ -139,13 +139,13 @@ exports.beautify = function(session) { breakBefore = true; // trim value if not in a comment or string - if (!is(token, "comment") && !token.type.match(/^(comment|string)$/)) + if (!is(token, "comment") && !/^(comment|string)$/.test(token.type)) value = value.trimLeft(); } if (value) { // whitespace - if (token.type === "keyword" && value.match(/^(if|else|elseif|for|foreach|while|switch)$/)) { + if (token.type === "keyword" && /^(if|else|elseif|for|foreach|while|switch)$/.test(value)) { parents[depth] = value; trimNext(); diff --git a/src/layer/text.js b/src/layer/text.js index d3bc38f38b7..5de1d743bfc 100644 --- a/src/layer/text.js +++ b/src/layer/text.js @@ -385,10 +385,10 @@ var Text = function(parentEl) { valueFragment.appendChild(this.dom.createTextNode(i ? value.slice(i) : value, this.element)); - if (!this.$textToken[token.type]) { - var classes = "ace_" + token.type.replace(/\./g, " ace_"); + if (!this.$textToken[token.type.toString()]) { + var classes = "ace_" + token.type.toString().replace(/\./g, " ace_"); var span = this.dom.createElement("span"); - if (token.type == "fold") + if (token.type.toString() === "fold") span.style.width = (token.value.length * this.config.characterWidth) + "px"; span.className = classes; diff --git a/src/mode/_test/highlight_rules_test.js b/src/mode/_test/highlight_rules_test.js index e8940f99189..c151aff88c2 100644 --- a/src/mode/_test/highlight_rules_test.js +++ b/src/mode/_test/highlight_rules_test.js @@ -140,7 +140,7 @@ function checkModes() { } function generateTestData(names, force) { - var docRoot = root + "/demo/kitchen-sink/docs"; + var docRoot = root + "/ace/demo/kitchen-sink/docs"; var docs = fs.readdirSync(docRoot); var specialDocs = fs.readdirSync(cwd); var modes = modeList(); @@ -203,7 +203,7 @@ function generateTestData(names, force) { var tokenizedLine = ""; data.tokens.forEach(function(x) { tokenizedLine += x.value; - tmp.push(JSON.stringify([x.type, x.value])); + tmp.push(JSON.stringify([x.type.toString(), x.value])); }); if (tokenizedLine != line) tmp.push(JSON.stringify(line)); diff --git a/src/mode/text.js b/src/mode/text.js index 607ef227df8..2b4a6bab377 100644 --- a/src/mode/text.js +++ b/src/mode/text.js @@ -1,11 +1,12 @@ "use strict"; var config = require("../config"); -var Tokenizer = require("../tokenizer").Tokenizer; +var {Tokenizer, CustomTokenizer} = require("../tokenizer"); var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var unicode = require("../unicode"); var lang = require("../lib/lang"); +var oop = require("../lib/oop"); var TokenIterator = require("../token_iterator").TokenIterator; var Range = require("../range").Range; @@ -356,4 +357,34 @@ var Mode = function() { this.$id = "ace/mode/text"; }).call(Mode.prototype); +var CustomMode = function () { + Mode.call(this); +}; +oop.inherits(CustomMode, Mode); + +(function () { + this.getTokenizer = function () { + if (!this.$tokenizer) { + this.$highlightRules = this.$highlightRules || new this.HighlightRules(this.$highlightRuleConfig); + var modeName; + if (this.$id) { + var chunks = this.$id.split('/'); + if (chunks.length > 1) { + modeName = chunks[chunks.length - 1]; + } + else { + modeName = chunks; + } + } + else { + modeName = "root"; + } + this.$tokenizer = new CustomTokenizer(this.$highlightRules.getRules(), modeName); + } + return this.$tokenizer; + }; +}).call(CustomMode.prototype); + + +exports.CustomMode = CustomMode; exports.Mode = Mode; diff --git a/src/mode/text_highlight_rules.js b/src/mode/text_highlight_rules.js index d8d109bed49..94d5d86c93b 100644 --- a/src/mode/text_highlight_rules.js +++ b/src/mode/text_highlight_rules.js @@ -77,12 +77,16 @@ var TextHighlightRules = function() { }; var pushState = function(currentState, stack) { - if (currentState != "start" || stack.length) - stack.unshift(this.nextState, currentState); + if (typeof currentState.get == "function") { + return currentState.get(this.nextState); + } + if (currentState !== "start" || stack.length) stack.unshift(this.nextState, currentState); return this.nextState; }; var popState = function(currentState, stack) { - // if (stack[0] === currentState) + if (typeof currentState.get == "function") { + return (currentState.parent.parent) ? currentState.parent : currentState.get("start"); + } stack.shift(); return stack.shift() || "start"; }; diff --git a/src/scope.js b/src/scope.js new file mode 100644 index 00000000000..ba1c0abe736 --- /dev/null +++ b/src/scope.js @@ -0,0 +1,44 @@ +"use strict"; + +var Scope = function (name, parent) { + this.name = name; + this.children = {}; + this.parent = parent; +}; +(function () { + Scope.prototype.toString = function () { + return this.name; + }; + + Scope.prototype.get = function (name, extraId = '') { + return this.children[name.toString() + extraId] || (this.children[name.toString() + extraId] = new Scope( + name, this)); + }; + Scope.prototype.find = function (states) { + var s = this; + while (s && !states[s.name]) { + s = s.parent; + } + return states[s ? s.name : "start"]; + }; + Scope.prototype.replace = function (a, b) { + return this.name.replace(a, b); + }; + Scope.prototype.indexOf = function (a, b) { + return this.name.indexOf(a, b); + }; + Scope.prototype.hasParent = function (states) { + var s = this; + while (s && states !== s.name) { + s = s.parent; + } + return s ? 1 : -1; + }; + Scope.prototype.count = function () { + var s = 1; + for (var i in this.children) s += this.children[i].count(); + return s; + }; +}).call(Scope.prototype); + +exports.Scope = Scope; \ No newline at end of file diff --git a/src/tokenizer.js b/src/tokenizer.js index f6b1338e8ce..4f72cb32388 100644 --- a/src/tokenizer.js +++ b/src/tokenizer.js @@ -1,6 +1,8 @@ "use strict"; var config = require("./config"); +var oop = require("./lib/oop"); +var {Scope} = require("./scope"); // tokenizing lines longer than this makes editor very slow var MAX_TOKEN_COUNT = 2000; /** @@ -336,4 +338,193 @@ var Tokenizer = function(rules) { }).call(Tokenizer.prototype); +/** + * This class takes a set of highlighting rules, and creates a tokenizer out of them. + * @class CustomTokenizer + * @extends Tokenizer + **/ + +/** + * Constructs a new experimental tokenizer based on the given rules and flags. + * @param {Object} rules The highlighting rules + * @param {String} modeName The highlighting mode name + * + * @constructor + **/ +var CustomTokenizer = function(rules, modeName) { + Tokenizer.call(this, rules); + this.rootScope = new Scope(modeName); +} +oop.inherits(CustomTokenizer, Tokenizer); + +(function() { + /** + * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. + * @param {String} line + * @param {String|Scope} startState + * @returns {Object} + * @override + **/ + this.getLineTokens = function(line, startState) { + var stack = []; + + var currentState = (startState !== undefined) ? (startState instanceof Scope) ? startState + : this.rootScope.get(startState) : this.rootScope.get("start"); + var state = this.states[currentState]; + if (!state) { + currentState = this.rootScope.get("start"); + state = this.states[currentState]; + } + var mapping = this.matchMappings[currentState]; + var re = this.regExps[currentState]; + re.lastIndex = 0; + + var match, tokens = []; + var lastIndex = 0; + var matchAttempts = 0; + + var token = {type: null, value: ""}; + + while (match = re.exec(line)) { + var type = currentState.get(mapping.defaultToken); + var rule = null; + var rememberedState = undefined; + var value = match[0]; + var index = re.lastIndex; + + if (index - value.length > lastIndex) { + var skipped = line.substring(lastIndex, index - value.length); + if (token.type && token.type === type) { + token.value += skipped; + } else { + if (token.type) + tokens.push(token); + token = {type: currentState.get(type), value: skipped}; + } + } + + for (var i = 0; i < match.length-2; i++) { + if (match[i + 1] === undefined) + continue; + + rule = state[mapping[i]]; + + if (rule.onMatch) { + type = rule.onMatch(value, currentState, stack, line); + if (!(type instanceof Scope)) { + if (!Array.isArray(type)) { + type = currentState.get(type.toString()); + } else { + for (var i = 0; i < type.length; i++) { + type[i].type = currentState.get(type[i].type.toString()); + } + } + } else { + rememberedState = type.parent; + if (currentState !== rememberedState) { + currentState = rememberedState; + state = this.states[currentState]; + mapping = this.matchMappings[currentState]; + lastIndex = index; + re = this.regExps[currentState]; + re.lastIndex = index; + } + } + } + else { + if (rule.token) + type = currentState.get(rule.token); + } + + if (rule.next) { + if (!rememberedState) { + if (typeof rule.next !== 'function') { + currentState = currentState.parent.get(rule.next); + } else { + currentState = rule.next(currentState, stack); + } + } else { + currentState = rememberedState; + } + + state = this.states[currentState]; + if (!state) { + this.reportError("state doesn't exist", currentState); + currentState = this.rootScope.get("start"); + state = this.states[currentState]; + } + mapping = this.matchMappings[currentState]; + lastIndex = index; + re = this.regExps[currentState]; + re.lastIndex = index; + } + if (rule.consumeLineEnd) + lastIndex = index; + break; + } + + if (value) { + if (!Array.isArray(type)) { + if ((!rule || rule.merge !== false) && token.type === type) { + token.value += value; + } else { + if (token.type) + tokens.push(token); + token = {type: currentState.get(type), value: value}; + } + } else if (type) { + if (token.type) + tokens.push(token); + token = {type: null, value: ""}; + for (var i = 0; i < type.length; i++) { + type[i].type=currentState.get(type[i].type); + tokens.push(type[i]); + } + } + } + + if (lastIndex === line.length) + break; + + lastIndex = index; + + if (matchAttempts++ > MAX_TOKEN_COUNT) { + if (matchAttempts > 2 * line.length) { + this.reportError("infinite loop with in ace tokenizer", { + startState: startState, + line: line + }); + } + // chrome doens't show contents of text nodes with very long text + while (lastIndex < line.length) { + if (token.type) + tokens.push(token); + token = { + value: line.substring(lastIndex, lastIndex += 500), + type: currentState.get("overflow") + }; + } + currentState = this.rootScope.get("start"); + break; + } + } + + if (token.type) + tokens.push(token); + + if (!tokens.length || tokens[tokens.length - 1].type.parent !== currentState) { + token = { + value: "", + type: currentState.get("empty") + }; + tokens.push(token); + } + + return { + tokens: tokens + }; + }; +}).call(CustomTokenizer.prototype); + exports.Tokenizer = Tokenizer; +exports.CustomTokenizer = CustomTokenizer; \ No newline at end of file diff --git a/src/tooltip.js b/src/tooltip.js index 64803f8d86d..84f5c49698b 100644 --- a/src/tooltip.js +++ b/src/tooltip.js @@ -40,7 +40,7 @@ function Tooltip (parentNode) { * @param {String} text **/ this.setText = function(text) { - this.getElement().textContent = text; + this.getElement().textContent = text.toString(); }; /** @@ -55,8 +55,8 @@ function Tooltip (parentNode) { * @param {Number} y **/ this.setPosition = function(x, y) { - this.getElement().style.left = x + "px"; - this.getElement().style.top = y + "px"; + this.getElement().style.left = Math.round(x) + "px"; + this.getElement().style.top = Math.round(y) + "px"; }; /** From ab34bf69fa416cfd2ad406dcb95b90c2f549fc1c Mon Sep 17 00:00:00 2001 From: mkslanc Date: Fri, 9 Sep 2022 18:37:30 +0400 Subject: [PATCH 02/45] lua mode with custom tokenizer --- src/mode/lua.js | 2 +- src/mode/lua_highlight_rules.js | 38 ++++++++++++++------------------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/mode/lua.js b/src/mode/lua.js index 4cbd86321f7..17e1ffbd88d 100644 --- a/src/mode/lua.js +++ b/src/mode/lua.js @@ -1,7 +1,7 @@ "use strict"; var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; +var TextMode = require("./text").CustomMode; var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules; var LuaFoldMode = require("./folding/lua").FoldMode; var Range = require("../range").Range; diff --git a/src/mode/lua_highlight_rules.js b/src/mode/lua_highlight_rules.js index 43da728cc4f..6e87bdc283d 100644 --- a/src/mode/lua_highlight_rules.js +++ b/src/mode/lua_highlight_rules.js @@ -64,25 +64,22 @@ var LuaHighlightRules = function() { this.$rules = { "start" : [{ stateName: "bracketedComment", - onMatch : function(value, currentState, stack){ - stack.unshift(this.next, value.length - 2, currentState); - return "comment"; + onMatch : function(value, scope){ + var parent = scope.get("bracketedComment" + (value.length - 2)) + parent.meta = (value.length - 2); + return parent.get(this.next).get("comment"); }, regex : /\-\-\[=*\[/, next : [ { - onMatch : function(value, currentState, stack) { - if (value.length == stack[1]) { - stack.shift(); - stack.shift(); - this.next = stack.shift(); + onMatch : function(value, scope) { + if (scope.parent && value.length == scope.parent.meta) { + return scope.parent.parent.get("comment"); } else { - this.next = ""; + return scope.get("comment"); } - return "comment"; }, regex : /\]=*\]/, - next : "start" }, { defaultToken : "comment" } @@ -95,26 +92,23 @@ var LuaHighlightRules = function() { }, { stateName: "bracketedString", - onMatch : function(value, currentState, stack){ - stack.unshift(this.next, value.length, currentState); - return "string.start"; + onMatch : function(value, scope){ + var parent = scope.get("bracketedString" + value.length); + parent.meta = value.length; + return parent.get(this.next).get("string.start"); }, regex : /\[=*\[/, next : [ { - onMatch : function(value, currentState, stack) { - if (value.length == stack[1]) { - stack.shift(); - stack.shift(); - this.next = stack.shift(); + onMatch : function(value, scope) { + if (scope.parent && value.length == scope.parent.meta) { + return scope.parent.parent.get("string.end"); } else { - this.next = ""; + return scope.get("string.end"); } - return "string.end"; }, regex : /\]=*\]/, - next : "start" }, { defaultToken : "string" } From f80aa3894af663d35de54a18fadd6112356eef9d Mon Sep 17 00:00:00 2001 From: mkslanc Date: Tue, 14 Feb 2023 15:45:06 +0400 Subject: [PATCH 03/45] fix scopes --- src/scope.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/scope.js b/src/scope.js index ba1c0abe736..b23a43a229d 100644 --- a/src/scope.js +++ b/src/scope.js @@ -1,7 +1,7 @@ "use strict"; var Scope = function (name, parent) { - this.name = name; + this.name = name.toString(); this.children = {}; this.parent = parent; }; @@ -9,7 +9,6 @@ var Scope = function (name, parent) { Scope.prototype.toString = function () { return this.name; }; - Scope.prototype.get = function (name, extraId = '') { return this.children[name.toString() + extraId] || (this.children[name.toString() + extraId] = new Scope( name, this)); @@ -39,6 +38,18 @@ var Scope = function (name, parent) { for (var i in this.children) s += this.children[i].count(); return s; }; + /** + * + * @returns {string[]} + */ + Scope.prototype.getAllScopeNames = function () { + var scopeNames = []; + var self = this; + do { + scopeNames.push(self.name); + } while (self = self.parent); + return scopeNames; + }; }).call(Scope.prototype); exports.Scope = Scope; \ No newline at end of file From 0f247a1c261bd296feb96a34a89b8f8bd6bd226a Mon Sep 17 00:00:00 2001 From: mkslanc Date: Tue, 14 Feb 2023 15:45:47 +0400 Subject: [PATCH 04/45] reqork markdown mode based on new scopes --- src/mode/markdown.js | 6 +- src/mode/markdown_highlight_rules.js | 1217 ++++++++++++++++++++++---- 2 files changed, 1054 insertions(+), 169 deletions(-) diff --git a/src/mode/markdown.js b/src/mode/markdown.js index f2a067ebb72..628be78c0d0 100644 --- a/src/mode/markdown.js +++ b/src/mode/markdown.js @@ -1,10 +1,7 @@ "use strict"; var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var JavaScriptMode = require("./javascript").Mode; -var XmlMode = require("./xml").Mode; -var HtmlMode = require("./html").Mode; +var TextMode = require("./text").CustomMode; var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighlightRules; var MarkdownFoldMode = require("./folding/markdown").FoldMode; @@ -27,7 +24,6 @@ oop.inherits(Mode, TextMode); (function() { this.type = "text"; - this.blockComment = {start: ""}; this.$quotes = {'"': '"', "`": "`"}; this.getNextLineIndent = function(state, line, tab) { diff --git a/src/mode/markdown_highlight_rules.js b/src/mode/markdown_highlight_rules.js index 26dbb8ce912..83cc53e295d 100644 --- a/src/mode/markdown_highlight_rules.js +++ b/src/mode/markdown_highlight_rules.js @@ -3,183 +3,1072 @@ var modes = require("../config").$modes; var oop = require("../lib/oop"); -var lang = require("../lib/lang"); var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; - -var escaped = function(ch) { - return "(?:[^" + lang.escapeRegExp(ch) + "\\\\]|\\\\.)*"; -}; +var lang = require("../lib/lang"); -var MarkdownHighlightRules = function() { - HtmlHighlightRules.call(this); +var tagMap = lang.createMap({ + a: 'anchor', + button: 'form', + form: 'form', + img: 'image', + input: 'form', + label: 'form', + option: 'form', + script: 'script', + select: 'form', + textarea: 'form', + style: 'style', + table: 'table', + tbody: 'table', + td: 'table', + tfoot: 'table', + th: 'table', + tr: 'table' +}); +var MarkdownHighlightRules = function () { // regexp must not have capturing parentheses // regexps are ordered -> the first match is used var codeBlockStartRule = { - token : "support.function", - regex : /^\s*(```+[^`]*|~~~+[^~]*)$/, - onMatch: function(value, state, stack, line) { - var m = value.match(/^(\s*)([`~]+)(.*)/); + token: "support.function", + regex: /\s*(```+[^`]*|~~~+[^~]*)/, + onMatch: function (value, scope, stack, line) { + var m = line.match(/^(.*)([`~]+)(.*)/); var language = /[\w-]+|$/.exec(m[3])[0]; // TODO lazy-load modes - if (!modes[language]) - language = ""; - stack.unshift("githubblock", [], [m[1], m[2], language], state); - return this.token; + if (!modes[language]) language = ""; + var parent = scope.get("codeBlock" + language); + parent.language = language; + parent.indent = m[1].length; + parent.endMarker = m[2]; + return parent.get(this.next).get(this.token); }, - next : "githubblock" + next: "githubblock" }; - var codeBlockRules = [{ - token : "support.function", - regex : ".*", - onMatch: function(value, state, stack, line) { - var embedState = stack[1]; - var indent = stack[2][0]; - var endMarker = stack[2][1]; - var language = stack[2][2]; - - var m = /^(\s*)(`+|~+)\s*$/.exec(value); - if ( - m && m[1].length < indent.length + 3 - && m[2].length >= endMarker.length && m[2][0] == endMarker[0] - ) { - stack.splice(0, 3); - this.next = stack.shift(); - return this.token; - } - this.next = ""; - if (language && modes[language]) { - var data = modes[language].getTokenizer().getLineTokens(value, embedState.slice(0)); - stack[1] = data.state; - return data.tokens; - } - return this.token; + var codeBlockRules = [ + { + token: "support.function", + regex: /.*/, + onMatch: function (value, scope, stack, line) { + if (scope.parent) { + var indent = scope.parent.indent; + var endMarker = scope.parent.endMarker; + var language = scope.parent.language; + var m = /^(\s*)(`+|~+)\s*$/.exec(value); + if (m && m[1].length < indent + 3 && m[2].length >= endMarker.length && m[2][0] === endMarker[0]) { + if (scope.parent.parent.name === 'listBlock') { + return scope.parent.parent.get("lineStart").get(this.token); + } + return scope.parent.parent.get(this.token); + } + if (language && modes[language]) { + var data = modes[language].getTokenizer().getLineTokens(value, scope); + return data.tokens; + } + } + + return scope.get(this.token); + } } - }]; - - this.$rules["start"].unshift({ - token : "empty_line", - regex : '^$', - next: "allowBlock" - }, { // h1 - token: "markup.heading.1", - regex: "^=+(?=\\s*$)" - }, { // h2 - token: "markup.heading.2", - regex: "^\\-+(?=\\s*$)" - }, { - token : function(value) { - return "markup.heading." + value.length; + ]; + + var listBlockStartRule = { // list + token: "markup.list", + regex: /^\s{0,3}(?:[*+-]|\d{1,9}[.)])(?:\s{1,4}|$)/, + onMatch: function (value, scope, stack, line) { + var indent = value.length; + var emptyList = false; + var minIndent = value.match(/^(\s{0,3})(?:[*+-]|\d{1,9}[.)])(?:\s{1,4}|$)/)[1].length; + if (/^\s{0,3}(?:[*+-]|\d{1,9}[.)])\s{5,}\S/.test(line)) { + indent = value.match(/^\s{0,3}(?:[*+-]|\d{1,9}[.)])\s/)[0].length; + } + if (/^\s{0,3}(?:[*+-]|\d{1,9}[.)])\s*$/.test(line)) { + indent = value.match(/^\s{0,3}(?:[*+-]|\d{1,9}[.)])/)[0].length + 1; + emptyList = true; + } + var parent = scope.get("listBlock", minIndent + ":" + indent); + parent.indent = indent; + parent.minIndent = indent; + if (emptyList) { + parent = parent.get("listBlockEmpty").get("lineStart"); + } + return parent.get(this.token + '.' + indent); }, - regex : /^#{1,6}(?=\s|$)/, - next : "header" - }, - codeBlockStartRule, - { // block quote - token : "string.blockquote", - regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+", - next : "blockquote" - }, { // HR * - _ - token : "constant", - regex : "^ {0,3}(?:(?:\\* ?){3,}|(?:\\- ?){3,}|(?:\\_ ?){3,})\\s*$", - next: "allowBlock" - }, { // list - token : "markup.list", - regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", - next : "listblock-start" - }, { - include : "basic" - }); + next: "listBlock" + }; + + var blockquoteStartRule = { // block quote + token: "string.blockquote", + regex: /^\s{0,3}>/, + next: "blockquote" + }; + + var escapeSymbols = /\\[\\!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/; + //TODO: * _ exclude????? + var punctuation = "*_!\"#$%&'()+,\\-./:;<=>?@\\[\\]^`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B"; + var punctuationAndSpaces = "\\s" + punctuation; + + this.$rules = { + "start": [ + { // HR * - _ + token: "constant", + regex: /^\s{0,2}(?:(?:\s?\*\s*){3,}|(?:\s?-\s*){3,}|(?:\s?_\s*){3,})\s*$/, + next: "start" + }, { // code block + token: "support.function", + regex: /^ {4,}/, + next: "codeBlockInline" + }, { // autolink + token: ["text", "url", "text"], + regex: /(<)((?:[-.\w+]+@[-a-z0-9]+(?:\.[-a-z0-9]+)*\.[a-z]+)|(?:[a-zA-Z][a-zA-Z0-9+.-]+:[^\s><]*))(>)/ + }, { + token: "indent", + regex: /^\s{0,3}(?=<\/?[a-zA-Z])/, + next: "html" + }, listBlockStartRule, codeBlockStartRule, blockquoteStartRule, { + token: "empty", + regex: /^\s*$/, + next: "start" + }, { + token: "empty", + regex: "", + next: "paragraph" + } + ] + }; this.addRules({ - "basic" : [{ - token : "constant.language.escape", - regex : /\\[\\`*_{}\[\]()#+\-.!]/ - }, { // code span ` - token : "support.function", - regex : "(`+)(.*?[^`])(\\1)" - }, { // reference - token : ["text", "constant", "text", "url", "string", "text"], - regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$" - }, { // link by reference - token : ["text", "string", "text", "constant", "text"], - regex : "(\\[)(" + escaped("]") + ")(\\]\\s*\\[)("+ escaped("]") + ")(\\])" - }, { // link by url - token : ["text", "string", "text", "markup.underline", "string", "text"], - regex : "(\\!?\\[)(" + // [ - escaped("]") + // link text or alt text - ")(\\]\\()"+ // ]( - '((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)' + // href or image - '(\\s*"' + escaped('"') + '"\\s*)?' + // "title" - "(\\))" // ) - }, { // strong ** __ - token : "string.strong", - regex : "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)" - }, { // emphasis * _ - token : "string.emphasis", - regex : "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)" - }, { // - token : ["text", "url", "text"], - regex : "(<)("+ - "(?:https?|ftp|dict):[^'\">\\s]+"+ - "|"+ - "(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+"+ - ")(>)" - }], - - // code block - "allowBlock": [ - {token : "support.function", regex : "^ {4}.+", next : "allowBlock"}, - {token : "empty_line", regex : '^$', next: "allowBlock"}, - {token : "empty", regex : "", next : "start"} - ], - - "header" : [{ - regex: "$", - next : "start" - }, { - include: "basic" - }, { - defaultToken : "heading" - } ], - - "listblock-start" : [{ - token : "support.variable", - regex : /(?:\[[ x]\])?/, - next : "listblock" - }], - - "listblock" : [ { // Lists only escape on completely blank lines. - token : "empty_line", - regex : "^$", - next : "start" - }, { // list - token : "markup.list", - regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", - next : "listblock-start" - }, { - include : "basic", noEscape: true - }, - codeBlockStartRule, - { - defaultToken : "list" //do not use markup.list to allow stling leading `*` differntly - } ], - - "blockquote" : [ { // Blockquotes only escape on blank lines. - token : "empty_line", - regex : "^\\s*$", - next : "start" - }, { // block quote - token : "string.blockquote", - regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+", - next : "blockquote" - }, { - include : "basic", noEscape: true - }, { - defaultToken : "string.blockquote" - } ], - - "githubblock" : codeBlockRules + "paragraph": [ + blockquoteStartRule, { // h1 + token: "markup.heading.1", + regex: /^\s{0,3}=+(?=\s*$)/, + next: "start" + }, { // h2 + token: "markup.heading.2", + regex: /^\s{0,3}\-+(?=\s*$)/, + next: "start" + }, { // HR * - _ + token: "constant", + regex: /^\s{0,2}(?:(?:\s?\*\s*){3,}|(?:\s?-\s*){3,}|(?:\s?_\s*){3,})\s*$/, + next: "start" + }, { + token: function (value) { + return "markup.heading." + value.match(/#/g).length; + }, + regex: /^\s{0,3}#{1,6}(?=\s|$)/, + push: "header" + }, { // list start with 1. or * or - + token: "markup.list", + regex: /^\s{0,3}(?:[*+-]|1[.)])(?:\s{1,4})/, + onMatch: function (value, scope, stack, line) { + var indent = value.length; + var minIndent = value.match(/^(\s{0,3})(?:[*+-]|\d{1,9}[.)])(?:\s{1,4}|$)/)[1].length; + if (/^\s{0,3}(?:[*+-]|\d{1,9}[.)])\s{5,}\S/.test(line)) { + indent = value.match(/^\s{0,3}(?:[*+-]|\d{1,9}[.)])\s/)[0].length; + } + var parent = scope.parent.get("start").get("listBlock", minIndent + ":" + indent); + parent.indent = indent; + parent.minIndent = indent; + return parent.get(this.token + '.' + indent); + }, + next: "listBlock" + }, { + token: "empty", + regex: /^\s*$/, + next: "start" + }, {include: "basic"} + ], + "basic": [ + { + token: "constant.language.escape", + regex: escapeSymbols + }, { // code span ` + token: "support.function", + regex: /(`+)/, + onMatch: function (value, scope, stack, line) { + var parent = scope.get("codeSpan", value.length); + parent.codeNum = value.length; + return parent.get(this.token); + }, + next: "codeSpan" + }, { // images + token: "text", + regex: /!\[(?=[^\]])/, + push: "imageLabel" + }, { // reference + token: "text", + regex: /\[(?=[^\]])/, + push: "linkLabel" + }, {include: "strongStates"}, { + token: "string.emphasis", + regex: "(?<=[\\s]|^)[*](?=[^\\s])|[*](?=[^" + punctuationAndSpaces + "])|(?<=[" + punctuation + + "])[*](?=[^\\s])", + push: "emphasisState" + }, { + token: "string.emphasis", + regex: "(?<=[" + punctuation + "])[_](?=[^" + punctuationAndSpaces + "])|(?<=[" + punctuation + + "])[_](?=[^\\s]|^)|(?<=[\\s])[_](?=[^" + punctuationAndSpaces + "])|(?<=[\\s]|^)[_](?=[^\\s])", + push: "barEmphasisState" + }, { // autolink + token: ["text", "url", "text"], + regex: /(<)((?:[-.\w+]+@[-a-z0-9]+(?:\.[-a-z0-9]+)*\.[a-z]+)|(?:[a-zA-Z][a-zA-Z0-9+.-]+:[^\s><]*))(>)/ + }, {include: "tag"}, { + token: "comment", + regex: //, + next: "start" + }, { + defaultToken: "comment" + } + ] + } + ], + "codeSpan": [ + { + token: "support.function", + regex: /(`+)/, + onMatch: function (value, scope, stack, line) { + if (scope.codeNum === value.length) { + return scope.parent.get(this.token); + } + return scope.get(this.token); + } + }, { + defaultToken: "support.function" + } + ], + "emphasisState": [ + {include: "strongStates"}, { + token: "string.emphasis", + regex: "(?<=[^\\s])[*](?=[\\s]|$)|(?<=[^" + punctuationAndSpaces + "])[*]|(?<=[^\\s])[*](?=[" + + punctuation + "])", + next: "pop" + }, { + token: "empty", + regex: /^\s*$/, + next: "pop" + }, {include: "basic"}, { + defaultToken: "string.emphasis" + } + ], + "barEmphasisState": [ + {include: "strongStates"}, { + token: "string.emphasis", + regex: "(?<=[^" + punctuationAndSpaces + "])[_](?=[" + punctuationAndSpaces + "]|$)|(?<=[^\\s])[_](?=[" + + punctuationAndSpaces + "]|$)", + next: "pop" + }, { + token: "empty", + regex: /^\s*$/, + next: "pop" + }, {include: "basic"}, + { + defaultToken: "string.emphasis" + } + ], + "strongState": [ + { + token: "string.strong", + regex: "(?<=[^\\s])[*]{2}(?=[\\s]|$)|(?<=[^" + punctuationAndSpaces + "])[*]{2}|(?<=[^\\s])[*]{2}(?=[" + + punctuation + "])", + next: "pop" + }, { + token: "empty", + regex: /^\s*$/, + next: "pop" + }, {include: "basic"}, + { + defaultToken: "string.strong" + } + ], + "barStrongState": [ + { + token: "string.strong", + regex: "(?<=[^" + punctuationAndSpaces + "])[_]{2}(?=[" + punctuationAndSpaces + + "]|$)|(?<=[^\\s])[_]{2}(?=[" + punctuationAndSpaces + "]|$)", + next: "pop" + }, { + token: "empty", + regex: /^\s*$/, + next: "pop" + }, {include: "basic"}, + { + defaultToken: "string.strong" + } + ], + "strongStates": [ + { + token: "string.strong", + regex: "(?<=[\\s]|^)[*]{2}(?=[^\\s])|[*]{2}(?=[^" + punctuationAndSpaces + "])|(?<=[" + punctuation + + "])[*]{2}(?=[^\\s])", + push: "strongState" + }, { + token: "string.strong", + regex: "(?<=[" + punctuation + "])[_]{2}(?=[^" + punctuationAndSpaces + "])|(?<=[" + punctuation + + "])[_]{2}(?=[^\\s]|^)|(?<=[\\s])[_]{2}(?=[^" + punctuationAndSpaces + + "])|(?<=[\\s]|^)[_]{2}(?=[^\\s])", + push: "barStrongState" + } + ], + "header": [ + { + token: "heading", + regex: /(?=$)/, + next: "pop" + }, { + token: "empty", + regex: /^\s*$/, + next: "pop" + }, { + include: "basic" + }, { + defaultToken: "heading" + } + ], + + "listBlock": [ + { // block quote + token: "string.blockquote", + regex: /\s*>\s?/, + onMatch: function (value, scope, stack, line) { + var currentIndent; + this.next = ''; + if (/(?<=^\s*[*+-]\s|\d{1,9}[.)]\s)([\s]*)>/.test(line)) { + currentIndent = line.match(/(?<=^\s*[*+-]\s|\d{1,9}[.)]\s)([\s]*)>/)[0].length; + } + else { + if (/^([\s]*)>/.test(line)) { + currentIndent = line.match(/^([\s]*)>/)[0].length; + } + else { + return "list"; + } + } + + var checker = false; + var currentScope = scope; + + if (scope.parent.name === "listBlockEmpty") { + if (/(?:[*+-]|\d+[.)])\s+/.test(line)) { + if (currentIndent >= 4) { + return scope.get("codeBlockInline").get("support.function"); + } + } + else if (currentIndent >= scope.parent.parent.indent + 4) { + return scope.get("codeBlockInline").get("support.function"); + } + } + + while (checker === false) { + if (currentScope.parent.name === "start") checker = true; + if (currentScope.indent <= currentIndent) { + checker = true; + } + if (checker === false) { + currentScope = currentScope.parent; + } + } + if (currentIndent > currentScope.indent + 4) { + return scope.get("list." + currentScope.parent.indent); + } + return currentScope.get("blockquote").get(this.token + '.' + currentScope.indent); + }, + next: "blockquote" + }, { // HR + token: "constant", + regex: /^\s{0,2}(?:(?:\s?\*\s*){3,}|(?:\s?-\s*){3,}|(?:\s?_\s*){3,})\s*$/, + onMatch: function (value, scope, stack, line) { + var currentScope = scope.parent; + while (currentScope.name !== "start") { + currentScope = currentScope.parent; + } + return currentScope.get(this.token); + } + }, { // sublist + token: function (value, scope) { + return "markup.list." + scope.indent; + }, + regex: /(?<=^\s*)(?:[*+-]|\d+[.)])(?:\s{1,4}|$)/ + }, {include: "containerBlockInlinesList"}, {include: "basic"}, codeBlockStartRule, { + token: "empty", + regex: /(?=$)/, + push: "lineStart" + }, {defaultToken: "list"} + ], + "lineStart": [ + { + token: "indent", + regex: /^\s*/, + onMatch: function (value, scope, stack, line) { + var currentScope = scope.parent; + if (/^\s*$/.test(line)) { + if (currentScope.name !== "listBlockEmpty") { + currentScope = currentScope.get("listBlockEmpty"); + } + return currentScope.get("lineStart").get("empty"); + } + else { + var currentIndent = value.length; + var checker = false; + + while (checker === false) { + if (currentScope.parent.name === "start") { + checker = true; + } + + if (currentScope.indent <= currentIndent) { + checker = true; + } + if (checker === false) { + currentScope = currentScope.parent; + } + } + if (/^[\s]*(?:[*+-]|\d+[.)])\s{1,4}/.test(line)) { + var sublistIndent = line.match(/^[\s]*(?:[*+-]|\d{1,9}[.)])\s{1,4}/)[0].length; + if ((scope.parent.name === "listBlockEmpty" && currentIndent + >= currentScope.parent.parent.indent && currentIndent + <= currentScope.parent.parent.indent + 3) || (currentIndent >= currentScope.indent + && currentIndent <= currentScope.indent + 3)) { + currentScope = scope.get("listBlock", currentIndent + ":" + sublistIndent); + currentScope.indent = sublistIndent; + currentScope.minIndent = currentIndent; + return currentScope.get(this.token); + } + currentScope = currentScope.parent.get("listBlock", currentIndent + ":" + sublistIndent); + currentScope.indent = sublistIndent; + currentScope.minIndent = currentIndent; + } + if (scope.parent.name === "listBlockEmpty") { + if (currentIndent >= scope.parent.parent.indent + 4) { + return scope.get("codeBlockInline").get(this.token); + } + } + if (scope.parent.name === "listBlockEmpty" && (currentScope.parent.parent.indent + && currentScope.parent.parent.indent > currentIndent || !currentScope.parent.parent.indent + && currentScope.indent > currentIndent) && !/^[\s>]*(?:[*+-]|\d+[.)])\s+/.test(line)) { + var parentState = (currentScope.parent.parent.indent) ? currentScope.parent.parent.parent + : currentScope.parent; + return parentState.parent.get("start").get(this.token); + } + return currentScope.get(this.token); + } + } + } + ], + + "blockquote": [ + listBlockStartRule, codeBlockStartRule, { // Blockquotes only escape on blank lines. + token: "string.blockquote", + regex: /^[\s>]*$/, + onMatch: function (value, scope, stack, line) { + this.next = "start"; + var parent = scope; + if (scope.parent.name === "listBlock") { + parent = scope.get("listBlockEmpty"); + parent = parent.get("lineStart"); + return parent.get(this.token); + } + return this.token; + }, + next: "start" + }, { // HR + token: "constant", + regex: /^\s{0,2}(?:(?:\s?\*\s*){3,}|(?:\s?-\s*){3,}|(?:\s?_\s*){3,})\s*$/, + next: "start" + }, {include: "containerBlockInlinesBlockquote"}, {include: "basic"}, {defaultToken: "string.blockquote"} + ], + + "linkLabel": [ + { + token: "empty_line", + regex: /^\s*$/, + next: "pop" + }, {include: "basic"}, { + token: "text", + regex: /\[/, + next: "pop" + }, { + token: ["text", "paren.lpar", "text"], + regex: /(\])(\()(\s*)/, + next: "linkDestinationInner" + }, { + token: "text", + regex: /\]:\s*/, + next: "linkDestination" + }, { + token: "text", + regex: /\]/, + next: "pop" + }, {defaultToken: "constant"} + ], + "imageLabel": [ + { + token: "empty_line", + regex: /^\s*$/, + next: "pop" + }, { + token: "string", + regex: /\[/, + next: "pop" + }, { + token: ["text", "paren.lpar", "text"], + regex: /(\])(\()(\s*)/, + next: "linkDestinationInner" + }, { + token: "text", + regex: /\]:\s*/, + next: "linkDestination" + }, { + token: "text", + regex: /\]\s*/, + next: "pop" + }, {defaultToken: "constant"} + ], + "linkDestination": [ + { + token: "empty_line", + regex: /^\\s*$/, + next: "pop" + }, { + token: "constant.language.escape", + regex: escapeSymbols + }, { + token: "punctuation", + regex: /)(\s+)/, + next: "linkTitle" + }, { + token: "punctuation", + regex: /(>)/, + next: "pop" + }, {defaultToken: "markup.underline"} + ] + }, { + token: "markup.underline", + regex: /(\S+)/, + next: [ + { + token: "text", + regex: /(\s+)|^(\s*)/, + next: "linkTitle" + } + ] + }, { + token: "text", + regex: /(\s+)/ + },//TODO: and includes parentheses only if (a) they are backslash-escaped or (b) they are part of a balanced pair of unescaped parentheses. (Implementations may impose limits on parentheses nesting to avoid performance issues, but at least three levels of nesting should be supported.) + {defaultToken: "markup.underline"} + ], + "linkDestinationInner": [ + { + token: "paren.rpar", + regex: /(?)(\s*)/, + next: "linkTitleInner" + }, { + defaultToken: "markup.underline" + } + ] + }, { + token: "markup.underline", + regex: /([^\s\)]+)/, + next: [ + { + token: "text", + regex: /(\s+)|^(\s*)/, + next: "linkTitleInner" + }, { + token: "paren.rpar", + regex: /(?])\s{0,3}#{1,6}(?=\s|$)/, + push: "header" + }, { // code block + token: "support.function", + regex: /(?<=[>] {5})./, + push: "codeBlockInline" + }, { // list + token: "markup.list", + regex: /(?<=[>]\s{0,4})(?:[*+-]|\d{1,9}[.)])\s{1,4}/, + next: "listBlockInline" + }, {defaultToken: "string.blockquote"} + ], + "containerBlockInlinesList": [ + { // code block + token: "support.function", + regex: /(?<=[*+-]\s{1,4}|\d{1,9}[.)]\s{1,4}) .*$/ + }, {//atx heading for block construction + token: function (value) { + return "markup.heading." + value.match(/#/g).length; + },//TODO: heading for indented lists + regex: /(?<=[*+-]\s{1,4}|\d{1,9}[.)]\s{1,4})#{1,6}(?=\s|$)/, + push: "header" + }, { // HR + token: "constant", + regex: /(?<=[*+-]\s{1,4}|\d{1,9}[.)]\s{1,4})(?:(?:\s?\*\s*){3,}|(?:\s?-\s*){3,}|(?:\s?_\s*){3,})\s*$/, + next: "start" + } + ], + "listBlockInline": [ + { // code block + token: "support.function", + regex: / {5}./, + next: "codeBlockInline" + }, { + token: "empty", + regex: /^\s*$/, + next: "start" + }, { // list + token: "markup.list", + regex: /^\s{0,3}(?:[*+-]|\d{1,9}[.)])(?:\s{1,4}|$)/, + onMatch: function (value, scope, stack, line) { + var indent = value.length; + var emptyList = false; + var minIndent = value.match(/^(\s{0,3})(?:[*+-]|\d{1,9}[.)])(?:\s{1,4}|$)/)[1].length; + if (/^\s{0,3}(?:[*+-]|\d{1,9}[.)])\s{5,}\S/.test(line)) { + indent = value.match(/^\s{0,3}(?:[*+-]|\d{1,9}[.)])\s/)[0].length; + } + if (/^\s{0,3}(?:[*+-]|\d{1,9}[.)])\s*$/.test(line)) { + indent = value.match(/^\s{0,3}(?:[*+-]|\d{1,9}[.)])/)[0].length + 1; + emptyList = true; + } + var currentScope = scope.parent; + while (currentScope.name !== "markdown") { + currentScope = currentScope.parent; + } + var parent = currentScope.get("start").get("listBlock", minIndent + ":" + indent); + parent.indent = indent; + parent.minIndent = indent; + if (emptyList) { + parent = parent.get("listBlockEmpty").get("lineStart"); + } + return parent.get(this.token + '.' + indent); + }, + next: "listBlock" + }, blockquoteStartRule, { // block quote + token: "string.blockquote", + regex: /(?<=[*+-]\s{1,4}|\d{1,9}[.)]\s{1,4})\s{0,3}>/, + next: "blockquoteInline" + }, {include: "basic"}, {defaultToken: "list"} + ], + "blockquoteInline": [ + { // code block + token: "support.function", + regex: / {5}./, + next: "codeBlockInline" + }, { + token: "empty", + regex: /^\s*$/, + next: "start" + }, listBlockStartRule, { // list + token: "markup.list", + regex: /(?<=[>])\s{0,3}(?:[*+-]|\d{1,9}[.)])\s{1,4}/, + next: "listBlockInline" + }, {include: "basic"}, {defaultToken: "string.blockquote"} + ], + "codeBlockInline": [ + { + token: "support.function", + regex: /(?=$)/, + onMatch: function (value, scope, stack, line) { + if (scope.parent.name === "markdown") { + return scope.parent.get("start").get(this.token); + } + + return scope.parent.get(this.token); + } + }, {defaultToken: "support.function"} + ], + "html": [ + { + regex: /(<)(script|style|pre)/, + onMatch: function (value, scope, stack, line) { + var tagName = value.substr(1); + stack.unshift(tagName); + return [ + { + type: scope.get("meta.tag.punctuation.tag-open.xml"), + value: "<" + }, { + type: scope.get("meta.tag.tag-name.xml"), + value: tagName + } + ]; + }, + next: function (scope, stack) { + var tagName = stack[0]; + stack = []; + var parent = scope.get("innerTagSpace", tagName); + parent.tagName = tagName; + return parent.get("tag_stuff"); + } + }, { + token: "comment", + regex: //, + next: "start" + }, { + defaultToken: "comment" + } + ] + }, {include: "tag"}, { + token: "empty", + regex: /^\s*$/, + onMatch: function (value, scope) { + var currentScope = scope; + while (currentScope.name !== "markdown") { + currentScope = currentScope.parent; + } + return currentScope.get("start").get(this.token); + } + }, { + token: "empty", + regex: /$/, + onMatch: function (value, scope) { + if (scope.parent.name === "html") { + return scope.parent.parent.get("start").get(this.token); + } + return scope.get(this.token); + } + } + ], + attributes: [ + { + token: "text.tag-whitespace.xml", + regex: /\s+/ + }, { + token: "entity.other.attribute-name.xml", + regex: /[-_a-zA-Z0-9:.]+/ + }, { + token: "keyword.operator.attribute-equals.xml", + regex: /=/, + push: [ + { + token: "text.tag-whitespace.xml", + regex: /\s+/ + }, { + token: "string.unquoted.attribute-value.html", + regex: /[^<>='"`\s]+/, + next: "pop" + }, { + token: "empty", + regex: "", + next: "pop" + } + ] + }, { + include: "attribute_value" + } + ], + tag: [ + { + token: function (start, tag) { + var group = tagMap[tag]; + return [ + "meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", + "meta.tag" + (group ? "." + group : "") + ".tag-name.xml" + ]; + }, + regex: /(<\/?)([a-zA-Z][-_a-zA-Z0-9:.]*)/, + next: function (scope, stack) { + if (scope.name === "html") { + return scope.parent.get("tag_stuff"); + } + return scope.get("tag_stuff"); + } + } + ], + tag_stuff: [ + {include: "attributes"}, { + token: "meta.tag.punctuation.tag-close.xml", + regex: /\/?>/, + onMatch: function (value, scope, stack, line) { + if (scope.parent.name === "innerTagSpace") { + if (scope.parent.parent.htmlBlock) { + var parent = scope.parent.parent.get("innerTagSpace", scope.parent.tagname + "inHtmlBlock"); + parent.htmlBlock = true; + parent.tagName = scope.parent.tagname; + return parent.get(this.token); + } + return scope.parent.get(this.token); + } + if (scope.parent.name !== "markdown") { + return scope.parent.get(this.token); + } + var parent = scope.parent.get(this.next, "htmlBlock"); + parent.htmlBlock = true; + return parent.get(this.token); + }, + next: "html" + }, { + token: "empty", + regex: /^\s*$/, + next: "start" + } + ], + "innerTagSpace": [ + { + regex: /(<\/)(script|style|pre)(>)/, + onMatch: function (value, scope, stack, line) { + var tokens = value.split(this.splitRegex); + if (tokens[2] === scope.tagName) { + if (/(<\/)(script|style|pre)(>)(.+)/.test(line)) { + stack[0] = "html"; + } + else { + stack[0] = "start"; + } + return [ + { + type: scope.get("meta.tag.punctuation.end-tag-open.xml"), + value: tokens[1] + }, { + type: scope.get("meta.tag.tag-name.xml"), + value: tokens[2] + }, { + type: scope.get("meta.tag.punctuation.tag-close.xml"), + value: tokens[3] + } + ]; + } + return scope.get("text"); + }, + next: function (scope, stack) { + if (stack.length > 0) { + if (stack[0] === "start") { + stack = []; + return scope.parent.parent.get("start"); + } + else { + stack = []; + return scope.parent.get("html"); + } + } + } + }, { + token: "empty", + regex: /^\s*$/, + onMatch: function (value, scope, stack, line) { + if (scope.htmlBlock) { + var currentScope = scope; + while (currentScope.name !== "markdown") { + currentScope = currentScope.parent; + } + return currentScope.get("start").get(this.token); + } + return scope.get(this.token); + } + } + ] }); this.normalizeRules(); From 83d1b1c7bda952422dba3b4651007a62d5020d1b Mon Sep 17 00:00:00 2001 From: mkslanc Date: Tue, 14 Feb 2023 16:15:31 +0400 Subject: [PATCH 05/45] add markdown tests; fix test runner to support scope-based tokenizers --- src/mode/_test/highlight_rules_test.js | 76 +- src/mode/_test/text_markdown.txt | Bin 484 -> 29582 bytes src/mode/_test/tokens_markdown.json | 11717 ++++++++++++++++++++++- src/mode/markdown.js | 4 +- 4 files changed, 11693 insertions(+), 104 deletions(-) diff --git a/src/mode/_test/highlight_rules_test.js b/src/mode/_test/highlight_rules_test.js index c151aff88c2..c3d899a5dde 100644 --- a/src/mode/_test/highlight_rules_test.js +++ b/src/mode/_test/highlight_rules_test.js @@ -45,15 +45,15 @@ function checkModes() { if (!m.$behaviour) console.warn("missing behavior in " + modeName); var tokenizer = m.getTokenizer(); - + testComments(m.lineCommentStart, testLineComment, tokenizer, modeName); testComments(m.blockComment, testBlockComment, tokenizer, modeName); testBrackets(m, modeName); - + if (m.snippetFileId) snippets[m.snippetFileId] = modeName; }); - + jsFileList(cwd + "../../snippets").forEach(function(snippetFileName) { if (/\.snippets$/.test(snippetFileName)) return; if (!snippets["ace/snippets/" + snippetFileName]) @@ -64,7 +64,7 @@ function checkModes() { console.error("Snippet files missing", snippets); throw new Error("Snippet files missing"); } - + function testComments(desc, fn, tokenizer, modeName) { if (desc) { if (Array.isArray(desc)) { @@ -76,24 +76,28 @@ function checkModes() { } } } - + function testBlockComment(tokenizer, blockComment, modeName) { if (blockComment.lineStartOnly) - return; // TODO test + return; // TODO test var str = blockComment.start + " " + blockComment.end; str = blockComment.start + str; if (blockComment.nestable) - str += blockComment.end; + str += blockComment.end; var data = tokenizer.getLineTokens(str, "start"); + + var type = data.tokens.length > 0 ? data.tokens[data.tokens.length - 1].type : ""; + var state = typeof type === "string" ? data.state : type.parent; + var isBroken = data.tokens.some(function(t) { return !/comment/.test(t.type); }); if (isBroken) { die("broken blockComment in " + modeName, data); } - if (!/start/.test(data.state)) { + if (!/start/.test(state)) { die("broken state after blockComment in " + modeName, data); } } - + function testLineComment(tokenizer, commentStart, modeName) { var tokens = tokenizer.getLineTokens(commentStart + " ", "start").tokens; if (!/comment/.test(tokens[0].type)) { @@ -103,11 +107,11 @@ function checkModes() { function testBrackets(mode, modeName) { if (/^(forth|mask)$/.test(modeName)) return; - + var session = new EditSession("{ foo[ bar(baz) ] }", mode); - - var isInvalid = session.getTokens(0).some(function(t) { - return /invalid|illegal|string/.test(t.type); + + var isInvalid = session.getTokens(0).some(function(t) { + return /invalid|illegal|string/.test(t.type); }); if (isInvalid) return; @@ -120,7 +124,7 @@ function checkModes() { position = session.findMatchingBracket({row:0, column:11}); if (!position || position.column != 14) die("Matching bracket not found in " + modeName); - + if (mode.$behaviour) { session.setValue(""); editor.setSession(session); @@ -162,7 +166,7 @@ function generateTestData(names, force) { if (names && names.length && names.indexOf(modeName) == -1) return; - + var outputPath = cwd + "tokens_" + modeName + ".json"; try { var oldOutput = require(outputPath); @@ -176,7 +180,7 @@ function generateTestData(names, force) { }).join(""); }).join("\n"); } - + var filePath = "text_" + modeName + ".txt"; if (specialDocs.indexOf(filePath) !== -1) { filePath = cwd + filePath; @@ -185,7 +189,7 @@ function generateTestData(names, force) { // oldText = ""; } var text = oldText ||fs.readFileSync(filePath, "utf8"); - + try { var Mode = require("../" + modeName).Mode; } catch(e) { @@ -196,26 +200,33 @@ function generateTestData(names, force) { var tokenizer = new Mode().getTokenizer(); var state = "start"; - var data = text.split(/\r\n|\r|\n/).map(function(line) { + var data = text.split(/\r\n|\r|\n/).map(function (line) { var data = tokenizer.getLineTokens(line, state); + + var type = data.tokens.length > 0 ? data.tokens[data.tokens.length - 1].type : ""; var tmp = []; - tmp.push(JSON.stringify(data.state)); + var stateString; + if (/^[\x00]/.test(line)) { + stateString = "start"; + } + else { + stateString = typeof type === "string" ? data.state : type.getAllScopeNames(); + } + tmp.push(JSON.stringify(stateString)); var tokenizedLine = ""; - data.tokens.forEach(function(x) { + data.tokens.forEach(function (x) { tokenizedLine += x.value; tmp.push(JSON.stringify([x.type.toString(), x.value])); }); - if (tokenizedLine != line) - tmp.push(JSON.stringify(line)); - state = data.state; + if (tokenizedLine !== line) tmp.push(JSON.stringify(line)); + state = typeof type === "string" ? data.state : type.parent; return tmp.join(",\n "); }); - + var jsonStr = "[[\n " + data.join("\n],[\n ") + "\n]]"; - - if (oldOutput && JSON.stringify(JSON.parse(jsonStr)) == JSON.stringify(oldOutput)) - return; - + + if (oldOutput && JSON.stringify(JSON.parse(jsonStr)) == JSON.stringify(oldOutput)) return; + fs.writeFileSync(outputPath, jsonStr, "utf8"); }); } @@ -258,18 +269,19 @@ function testMode(modeName, i) { var tokens = tokenizer.getLineTokens(line, state); var values = tokens.tokens.map(function(x) {return x.value;}); var types = tokens.tokens.map(function(x) {return x.type;}); - + var type = tokens.tokens.length > 0 ? tokens.tokens[tokens.tokens.length - 1].type: ""; + var stateString = /^[\x00]/.test(line) ? "start" : typeof type === "string" ? tokens.state : type.getAllScopeNames(); var err = testEqual([ - JSON.stringify(lineData.state), JSON.stringify(tokens.state), + JSON.stringify(lineData.state), JSON.stringify(stateString), lineData.types, types, lineData.values, values]); - + if (err) { console.log(line); throw "error"; } - state = tokens.state; + state = typeof type === "string" ? tokens.state : type.parent; }); } function testEqual(a) { diff --git a/src/mode/_test/text_markdown.txt b/src/mode/_test/text_markdown.txt index 557767368d6d3a75e744f1224b93537ed682e5f2..5c623e8585b877b9005f07ce37191528145a46b0 100644 GIT binary patch literal 29582 zcmd5_ZEqY$a?WQ0{0}YCM^Pg!$$cRylFOAPTZ$dn=Yy>zci}M0;c~>?({gujcWJ#` z&d3GG1^ILd@+kZzWYu9+1{-@%8_7Wbv9tE%g* zyQ{m0%S*rG+&rDlU440JdCB4D*?253r^#!1k)PAS#qx5F*vJsCM{Q=PiI7Q@{;z)V zSNf?S*;2fk@Xnf?CewiFwtQ{iLc`+h2u?@7mmeWjaM;!M3M#?wXDrEGP%Pa&!aZ|9 zYlKr*eE&M&Q{NKgRUz`k2vDbfBLNh@!iH39&7F)#sq}RIVtf*Usmdsd0ISuOm%80< z2&Dq=-n|=sN0l8O9){mhMbcgfSrXKcBL|2ma1j-+g%azzrb^#aL(*R=#R41D2;{x~ zCt%f3cdS9dweV|oz6dIeAYAb)#G$HcqG_}?FCi9HM*5Zm)z)?TA6#~MDS^hRbn0F{ zg>nRsbZe>KIa ziJn|2V3T@W)p%RYUyC=vyYQ{PFS^mBu2=P^6jn`Ycy-&Ij)!wbML(JK=gE1Xy(YCC zdkF%%)GE2T2)&P7jF;E3=>wI_P*W>szeVc-DRo+isJ(Trc;_np(O3tiGNeVN)1bm< zwUi@T)VERw0|^A-$W%gnd{@ZSD%3A%*Zd%#$d8CGqysXU_C3hJRQq`|2pqPg-bvCl zQnmX=Fbg`8QNSljY$8N#+RzMeVq^@(mF!~jMk{l6O`M{;*UL+ASXw0L54BG|?6c@5 z5PF*?cme_F63a_SZu%qM6?`wz%Ac??4U{1*FF^zdEX_kCO)nBP}6vvfMU zBkWEx{h)s*@J?8PZBRTiNV{9B9c-q2!`xJG5Mfz6Up$ z(zIby8YoMhwoBAM1(S432?D}YHl@mBrBu|k527p%Yfk2H1=0I7fXLVDUyh#JPtwL~C9mUari4}g9+_yF-Y7@cdEsHFTGI!-Ns$QL1d8csON58KKctKR$G z=>sz8dLW0lPoal3Q_3^M0<-2SwLNdlX*qnkt!dC6ll1dPACPnF8&vKq%*-&*EOw= z9QZd=3#r-MUDq`(5t+70l-PWy^S*$4Jqx|*<>{;CrL**zB#!l$a2E$ponKBz4wgtq zXBCI2XCe88SVh{a@72e(iHh!VmrjjtUX?0IqbS?BXCo31xssHH@JU}QCSEvdnPZ#{h&y!ah zAp>3WyY|`ObGC{4lvXK`a2smrw3BekR@XIudsACQzzCOn^#;AA{r-o4;NJV_;b)&6 zt^i{N^r4QAlj-xb@rzL;pW2(iv6Sg8B90rJX*-dnH%w-;!xea_knxNI8#L$+rdiNN zC?Ejd(v;5P6`)-aIl;>Ii7sO}088c)p&0ZQB2i-XsSrVZMYF(`UZ_#B6USa2V=8Ag}d?iYwBwuXZ%8LQo5tS;gOb%S(gN+`V*%uG!Q` z3;V0ZiCjEyWz`+5WSvGU5bZxqrX$Q;V8$FT|0?W?T6B<^u}phl+(xSt?ajexmJ<$% zdE=!+fr1pg58afHA(pouv2whHnBI)Q^wy}*QtKhc-7p!QUnb{R4WX*?9O1RnY0In^ zqF_plMU{J+zMOA-@bu%4Hl8NupN%gk5*rr@CIS2V?!!;qI?^mZ9=gd??D3A9B-2?6 zYz*c2B{Gs^mQ^Iq!>(yfq&@3R2a~y*znVZAEaT>zKTJMP^jnFJ%}w`v_~J7~OJ62B zWk-4*_bx9mVc$4U=Z}Y}ynXcQ!?X33v-D!Ta%W>O8l_X|0UTw82`?aYYXzRu-c&Z= zQW1_5gZ6CxO4kR0c)i(7X~HUoDMHj`3ek#z#{sZj;^3z ziPIL-P$$cae$k}^YTz*~I%zFK)8$GC*W99lO~Nh|(pCb$wNsfMVwF8yuh1CLA(6D(h=`#kLOMCsX zyWP1B4_aP&u%LyOn%cMC|Kz==Klt8bcHKnvwtCmCqxar_`1IisOno`($*kI4B=cVX z#dtlrcM2{1SVjrVuh$dTcBgJ_4Qtl6+q$FEYC`j=PMzX7_Y;>6F)Ig92TVT`+5#BB z92UPO-?0^S>}+cIbIW2$bV} zw|O}ox)qkiRzxU%ZLqyhIBlS;9NT5@g}J+pWuBJTZZD?OtfUW2I-g6LzR zJasRUR}M8fS$Yof51Hef$>0co}7mL*wZZLC`@nq(nO~)6q$bBwr1*}bT!K6%aybpa}ymAl> zrdG*vS%_dHp`(XZ04{s8yd)yQNb&;hzeS()e$(E!US6U$PBFkg=ZgF-1Q-;VRmBe$ z+l@hxp)GO{y1W;p%>d(vu(MiT%y6Kq&N@O=wI_aPaLeu)i_sXEzRumvt>odLyX4 zec+c6i}GZEd}Wf*0;McKHGybe@l~b;K69T|g6aT6Z=`3Evc+KXG3?#_1$kpSM%I{I z&iXN;QqqT({SUGU2TDwmTWZO4eCekWt4{LAaY??8gr(u8Hin-WZOb;#qHdI9Sa$-d zN%X$4GN{+!k#uKxaiM{!d@Wg(D@sCMd)+9+%YZdI8|mw7tFI!gMV}p?w>4o01I+!h z*BCW0rdd|PU~0;2buE<=CJ^xG^{^g0J2Szu$0+s`sx$>G0}vFpPM7h(?`v zGAwb-3Q|MMm=HB5$M;0Wca~&hi$;*1h3Lcsas9sBgqF$Cy|85@zYHN;fk99>bgwObj;|6dlXDZj1EHMYD%9TZyH)Nm2Y*^BwS@Qv_P7#6V;qyV{b`{QiX;_B!`j}w4(Wz#@>ny4%yBZ zZ#JobRCJJ00J3K@>&e|1u(TZOwPSu~7!omGX^ap;GcmtwWY}jya_g+X*uB zAivSK%)I(m;^ZPUn4X==D;z??6A_2YK86EOLyML5MzgiOvwMGU!_EpDO}ao1-rB&* zXkNyl8vtZxo{c8WzO~h?02szKbh=7QYlFGQGLggST0;*_Iadcu&3;+mh+fjL9-0zJ zB?5z>RSFkllt{}VuH`o|(IOi7u0jUiEvCfG>M2#l`9`F&=?l}aq(ZAAAGsju5h|Y7 zqSbKHF-Iu-X6wEax2cJ4h{Si^IlXK06Tb&55HP;gQbT9$gS4rIGPGL+)0oOxR>sNg zFseYKiom1{JyYriQZRh5q@nE=I~P_J8(M~9qew*KyShot+f*!bNF_60m6{h?`|9MZ z^((mfqEX<=abSU~i*>GHr&;=~{I2ZXTRC1i{OBn#5$r8}yr!3L=Xxbut+Fj(dd1NC zR#sOHuUd0kz(~4WW)?)pj-P=*D;@Vpjw5k~fHjw|sh?r(JGC>0?08zGO$P~0EAfk3 zF(dhOYmTT(P+^KMlJa{y(ckeC2Sx}+cApK3MtE0hp#up@*xE*^+N`y+%b2VONJ=`? z4c$}@U<;iPz+{8&*IYv*KLGA-m8KR8P7c{jkGM=RM*eQt6c+eu%or^K@(w?62RnI35^Ob+*Z0fjo|AlWQGfP~}(t2`;tYFUk!Q@}?8 zr6wEHK&?5PJCPSTUkEo5LBhl94XvBOH+Y`OiMz6*g0>i^!V*S9OJ-NGQAUBQ-_HiW zD)lOPAO1jPC*;NQrgd+rbv8{~n4NR)p zbVJ-h)T$GXk{CMA(3?Uzi$$Vn8H@dq(U5k-i3SZwwzYk>(V^EM<(n!Ytw*g?FlHa_6LXh9WU0 zPx^zCp}9rW*rP?_Tk%S~8ov{NCtizh$LsN(IEwGa_u^W-5pTx(@j={<593b!AbvMK zisSe={^PhCpTs|o|0MoN{DtW~O%_XN#Sh~oc5yTQ>Syu){&RrT)Vfz3$uc1=cJG## z;`Zru6Kg|!kJH__8nP50=?B@SIbPp{im=ZRpU9UIx+qcCV_k3H6!<_Y{&D2n`;V*s zqg0i#`y?bm#rvpRQS$Iw47{UWx&rvx`0`?S;G1E|IZb-94~{KyoSHQK;EXnoBj1Tx zIO}X~(R08H2i~p4n_KiB9DRX0kK(Wx+}xs{@Dv%^q55r)ku|l_*6z>e zll{$2f3RW$i|7Z>FsvNLQCLiBZqX_7V>Kw*PvgxyI0#WVPE%`J)Ym!@BH1{IBkaXeZPmTff2UD*Pg*t%@)4;U@*jpI{!?Ln+nF@8SOhCB*XUw@jaP*y%@~W_b`VV zUrs;7F>#c6VD+`p`Qrm40L{3z+S~?kRaVUMy0_Pm7i_|ZveK+;tKV-B`2F{{b_D5V zFFCb%G%@?+)?Nw<(L}J-z5Ba6+pT6pcK_E_lhYoKLCRMD+SC4E_TlWic;lgIR8+st}`y1)M3kV78UC$yC3ed1Y&j4hDxqxBH2 z@l`y;v?vn@JE28D`b)@UvD0Wp@Wc=|UZsZzCCEIEe=!`rHCv4Xxais{UNNHJt%-82 z=n!$jFR;p-g%p59d_vx0=)3X$hIWF0_{_bf}gS zK%~>mku3eUBHXiLf3CVpt1AUC%wdZQay@ zPB)Xx!l=8XOUW#Rz6W|;h+rUE$Jp-fbgc+lc6js4umAMTe|-JZum9}Lzr6Xy*FS&r z-(C5DFaQ0`e}DaRy!+|bKezN$I}qaZbfs(dQkz;{fE2YZ4slHH*oM@S^x5cCiv*dO ztYUZQZ5d2f7l96U=wi{jfK4puH8%xBcWfJ~Nm_`hLTY*pC9{Y#lIvQ&yDm_}N!RZR z=-S@u!`hX-8kmD1z#1D|g6-4VYcUTymYP*Z zOmE||gS^8wil|prHflC%5$fK839$9Xzu8P zRRph3V00y6h01Q}T9)!vl2U6cA7$W{Xo;kU&Km)B!7A-NMg^gKi~Yb=Cq%_9OH_Na zlpFi(JmNvsbIo_S$~+iiwvH-4z?XWOJg-LR&UYbAsHb{0iGJ&Xc=s2rTdnE*OKj%V zX2BX@g;Fgv%X2tzLZje!SVC{rtG5`w?VeIp$m0c)ckMVYG-Il6k*F`E^ukvI?T@MbO)+P_iW6!|SUB9tIwu93}q^+FMuYc#Qj z*}`Z>7wJUOd|{z}j20~y>A-}%uFZ9-5hfLjq?0r}jtG=6j7#3I2uwRFYi@R_DVb#ctSMg-=2aBKyNW+LxWWfFzKlBo^u&s5i?nMNB#+qf;E<{ zcIX!b#3ggkAqeT(Ce^9?Hx!`6D4TJ?;E=)a%AZgKShoZ!qR%!_w}9X!d`;r&oVJCZ zASoyeidHx)vTZb;$fd-mdJOcNs0ZF)Bw);m6}oW=lB=y7nI_x6{me=E#F0bMwc4Q| z$ZlaYlER`As7Q&niLPJKri7oRzA8kgT3{_8BU&)WDpAuZD`}M=KDhy84X%}rh)j%+ zXsN@eC|VAoWJ;&XPq*$BCC*oQ zmXls-Q5+q&ba~@WR!?+@D&cDqy>)ak9*>UK<@d%9C+Bw-NvQV8JE{UMLaZ(e7GGx0 z)1TaPmYdC|$qd;8xBRmOM8002emT&Jc3yj~{$*jus-=vq95lGVgFWyN06r087F>%= z&(70Y4>BS@XbVoi2wMKRQ`kQ+}CDwR8j?&}@rsI)X0B~f3>B^# zLD#m{lu?bRYa14B5`^~gwau!##=p6iGhfwEqX^NplK7H}_{a^Abx6t>T~C~gG@nc#H9+mZ7OcV&2x)s;+jTmsYMqesc7I9UdkS4WH9A3A#T zk8l3x&40c5C4T?svHc{4nZ$j1IhzfVk=)=uHq{w_n&L(Z>VUhw__!kZMX+a}(A00J3diFs( zXQU6D1X9F>KzO@=xTYnr#(7Z>_HKnQ3}LmnikqQ^iqK30cTg00vw&Y=O)r@kR=bf+ zmqM<3*5rt5db*QuReW(pTQ&LkZl{LW#Ks$zo{F?E z`H%ZJ8-vTnvbX>NdF$5XtKRe3O4!-T4I~^K_uIHPp0}eX?iN)=fpsx6Y#4!etGmm; z7N6_b(BVS86n^(jHA9y)q|i}uAo>oTyz}VcrwE)I>Y0A)&6+o{Dx#l${0h1hjS8pr z%}FxvZ_dYfgjQzF%pb6vw$16boemNHw%joOQaE0) zG*L}RNg%}40;Nh+nBj^+P0N(Gf&}cF-6R8R_3{>7inSjtkFS&RZ` z(Xc;kbfeyQYcdb0$LZU*4~BX`N)>Pu;neCk9xn8$<*}Oc2K2Q)n$7It(LCUb+-p|4 zdTwd~)~5U!CltN;tlc#{=eE&U!`;ncnv5&~MtplP?cvgh=d#~uG@J4eCyPmYw?BUP z;YUwD*+=}o3%A{P^ze@?7ERnv?w;Q5?c*_d!AwpsI<+rw5utWDsm*$Qlr)s9tH*G@9 z9j#tU>GoZSyb+*UG)@r(?e1)n_Hggy-A6zN?;4tI$*mlVuT}tleD`X?Y6RO@RgT9} z^5&24D4vU7=zd4fSG6zpaizopRMEbXNNB;-bhVglXj9LiP?p>vsfzJL;nU<452tNd zF|?j2e?g&r+Azl6(K;gbh#Y}-tb|ugBxbezSS#U%?_2TAwTaM3(VWJiH!9u?C-~H67Tq?Jt=ktd!fSMVd`K z-PLX-?bNGN?i+5k$Szs5inSLW@;fm5WIGEELVW|Gp5$!^>mR+@AKbQj(0FsO9?!&z z5vQB-mlwpvq2=izRLtWhw{XCztc_oLcPWzx2At|M7!O(Ax5BAs@nO{>jR7t=40Th@ zY-Z0P1yQSREn5mN-Y1^pY8J~Ka+9CW&czK(9?0&$n#kWvko(I)EH*Ok!Y zj~;*g_`6Tt>C`>`_y2q(Lv;VHo#J+uV~?}u6tM}vipnEnaD{8g_!1**^o1u4yi za4KHrPu#2xx72sEq$e=Fuxf$S@rmB3$6xUng?0KJEx!?pwpFlC{r&;-8F#BFt*qsG z%*7~Saa<)Z=(g6%gl_mHRptLuT5KTnQV%hJ%r7g(YGsay>Ql*%`oJAdv)nry2lD9L rY54bkc8b4u_SIi}_0wPd@@HTE!Z4+FKE}1F0sb-zt;Ro-GF$#X%c`wp literal 484 zcmZ{g!EVAZ42JJ{ieL0V3sS4?FbRZq*>>17Foe?9g^V<*h`X@2pUVnjo0dpX?ELos zIZT0<*psg5h&!mHQ3)Ewx9NM8NY4A8S#otiG`zgF z@u97$M-H(&uN%+7-&!B3MoI9_ej;?bqM^a>;tRx$sw9p?Zgl)pfJ6!ZFf*)ihXAaf ztncduUY}n!>7Kb;7DbFPuNJxSMJ5F^tZQoh^;N&?lRxhAo%~2&=9O;?;S=e4zDX%m zx})?h!*{GPVZ)Xt*YG^e1ex^hL$9q2IE(&xn4vL_kZ!5nX397L3>?&O>#UZO>BLx- Qk0Ydb<`)!UkO!r{0Bnnuc>n+a diff --git a/src/mode/_test/tokens_markdown.json b/src/mode/_test/tokens_markdown.json index 9ed34bc0d75..5bcd7a71756 100644 --- a/src/mode/_test/tokens_markdown.json +++ b/src/mode/_test/tokens_markdown.json @@ -1,119 +1,11696 @@ [[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 1"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," foo baz bim"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 2"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," foo baz bim"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 3"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," a a"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," ὐ a"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 4"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","lineStart","listBlock","start","markdown"], + ["markup.list.4"," - "], + ["list","foo"], + ["empty",""] +],[ + ["empty","lineStart","listBlockEmpty","listBlock","start","markdown"], + ["empty",""] +],[ + ["empty","lineStart","listBlock","start","markdown"], + ["indent"," "], + ["list","bar"], + ["empty",""] +],[ + ["empty","lineStart","listBlockEmpty","listBlock","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 5"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","lineStart","listBlock","start","markdown"], + ["markup.list.2","- "], + ["list","foo"], + ["empty",""] +],[ + ["empty","lineStart","listBlockEmpty","listBlock","start","markdown"], + ["empty",""] +],[ + ["empty","lineStart","listBlockEmpty","listBlock","start","markdown"], + ["indent"," "], + ["support.function","bar"], + ["empty",""] +],[ + ["empty","lineStart","listBlockEmpty","listBlock","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 6"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","blockquote","markdown"], + ["string.blockquote","> "], + ["support.function"," foo"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 7"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","lineStart","listBlock","start","markdown"], + ["markup.list.2","- "], + ["support.function"," foo"], + ["empty",""] +],[ + ["empty","lineStart","listBlockEmpty","listBlock","start","markdown"], + ["empty",""] +],[ "start", - ["text.xml","test: header 1 "] + ["text","\u0000 test 8"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," foo"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," bar"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] ],[ "start", - ["text.xml","#f"] + ["text","\u0000 test 9"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","lineStart","listBlock","start","markdown"], + ["markup.list.3"," - "], + ["list","foo"], + ["empty",""] +],[ + ["empty","lineStart","listBlock","lineStart","listBlock","start","markdown"], + ["indent"," "], + ["markup.list.5","- "], + ["list","bar"], + ["empty",""] +],[ + ["empty","lineStart","listBlock","lineStart","listBlock","lineStart","listBlock","start","markdown"], + ["indent"," "], + ["markup.list.7","- "], + ["list","baz"], + ["empty",""] +],[ + ["empty","lineStart","listBlockEmpty","listBlock","lineStart","listBlock","lineStart","listBlock","start","markdown"], + ["empty",""] ],[ "start", + ["text","\u0000 test 10"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], ["markup.heading.1","#"], - ["heading"," f"] + ["heading"," Foo"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 11"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant","* * * "] +],[ + ["empty","start","markdown"], + ["empty",""] ],[ "start", - ["text.xml","test: header 2"] + ["text","\u0000 test 12"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["support.function","codeSpan","listBlock","start","markdown"], + ["markup.list.2","- "], + ["support.function","`one"] +],[ + ["support.function","listBlock","start","markdown"], + ["support.function","- two"], + ["support.function","`"] +],[ + ["empty","lineStart","listBlock","start","markdown"], + ["empty",""] ],[ "start", - ["markup.heading.2","##"], - ["heading"," foo"] + ["list","\u0000 test 13"], + ["empty",""] +],[ + ["empty","lineStart","listBlockEmpty","listBlock","start","markdown"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant","***"] +],[ + ["constant","start","markdown"], + ["constant","---"] +],[ + ["constant","start","markdown"], + ["constant","___"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 14"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","+++"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 15"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["markup.heading.1","start","markdown"], + ["markup.heading.1","==="] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 16"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["markup.heading.2","start","markdown"], + ["markup.heading.2","--"] +],[ + ["empty","paragraph","markdown"], + ["string.emphasis","**"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], + ["string.emphasis","__"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 17"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant"," ***"] +],[ + ["constant","start","markdown"], + ["constant"," ***"] +],[ + ["constant","start","markdown"], + ["constant"," ***"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 18"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," ***"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 19"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Foo"] +],[ + ["string.strong","strongState","paragraph","markdown"], + ["text"," "], + ["string.strong","***"] +],[ + ["empty","paragraph","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 20"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant","_____________________________________"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 21"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant"," - - -"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 22"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant"," ** * ** * ** * **"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 23"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant","- - - -"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 24"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant","- - - -"] +],[ + ["empty","start","markdown"], + ["empty",""] ],[ "start", - ["text.xml","test: header ends with ' #'"] + ["text","\u0000 test 25"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","_ _ _ _ a"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","a------"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","---a---"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 26"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], + ["text"," "], + ["string.emphasis","*-*"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 27"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","lineStart","listBlock","start","markdown"], + ["markup.list.2","- "], + ["list","foo"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant","***"] +],[ + ["empty","lineStart","listBlock","start","markdown"], + ["markup.list.2","- "], + ["list","bar"], + ["empty",""] +],[ + ["empty","lineStart","listBlockEmpty","listBlock","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 28"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Foo"] +],[ + ["constant","start","markdown"], + ["constant","***"] +],[ + ["text","paragraph","markdown"], + ["text","bar"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 29"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Foo"] +],[ + ["markup.heading.2","start","markdown"], + ["markup.heading.2","---"] +],[ + ["text","paragraph","markdown"], + ["text","bar"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 30"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","lineStart","listBlock","start","markdown"], + ["markup.list.2","* "], + ["list","Foo"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant","* * *"] +],[ + ["empty","lineStart","listBlock","start","markdown"], + ["markup.list.2","* "], + ["list","Bar"], + ["empty",""] +],[ + ["empty","lineStart","listBlockEmpty","listBlock","start","markdown"], + ["empty",""] ],[ "start", + ["text","\u0000 test 31"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","lineStart","listBlock","start","markdown"], + ["markup.list.2","- "], + ["list","Foo"], + ["empty",""] +],[ + ["constant","start","start","markdown"], + ["markup.list.2","- "], + ["constant","* * *"] +],[ + ["empty","start","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 32"] +],[ + ["empty","start","start","markdown"], + ["empty",""] +],[ + ["empty","paragraph","start","markdown"], ["markup.heading.1","#"], - ["heading"," # # "] + ["heading"," foo"], + ["empty",""] +],[ + ["empty","paragraph","start","markdown"], + ["markup.heading.2","##"], + ["heading"," foo"], + ["empty",""] +],[ + ["empty","paragraph","start","markdown"], + ["markup.heading.3","###"], + ["heading"," foo"], + ["empty",""] +],[ + ["empty","paragraph","start","markdown"], + ["markup.heading.4","####"], + ["heading"," foo"], + ["empty",""] +],[ + ["empty","paragraph","start","markdown"], + ["markup.heading.5","#####"], + ["heading"," foo"], + ["empty",""] +],[ + ["empty","paragraph","start","markdown"], + ["markup.heading.6","######"], + ["heading"," foo"], + ["empty",""] +],[ + ["empty","start","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 33"] +],[ + ["empty","start","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","start","markdown"], + ["text","####### foo"] +],[ + ["empty","start","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 34"] +],[ + ["empty","start","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","start","markdown"], + ["text","#5 bolt"] +],[ + ["empty","start","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","start","markdown"], + ["text","#hashtag"] +],[ + ["empty","start","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 35"] +],[ + ["empty","start","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","start","markdown"], + ["constant.language.escape","\\#"], + ["text","# foo"] +],[ + ["empty","start","start","markdown"], + ["empty",""] ],[ "start", - ["text.xml","test: header ends with '#'"] + ["text","\u0000 test 36"] +],[ + ["empty","start","start","markdown"], + ["empty",""] +],[ + ["empty","paragraph","start","markdown"], + ["markup.heading.1","#"], + ["heading"," foo "], + ["string.emphasis","*bar*"], + ["heading"," "], + ["constant.language.escape","\\*"], + ["heading","baz"], + ["constant.language.escape","\\*"], + ["empty",""] +],[ + ["empty","start","start","markdown"], + ["empty",""] ],[ "start", + ["text","\u0000 test 37"] +],[ + ["empty","start","start","markdown"], + ["empty",""] +],[ + ["empty","paragraph","start","markdown"], ["markup.heading.1","#"], - ["heading"," foo# "] + ["heading"," foo"], + ["empty",""] +],[ + ["empty","start","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 38"] +],[ + ["empty","start","start","markdown"], + ["empty",""] +],[ + ["empty","paragraph","start","markdown"], + ["markup.heading.3"," ###"], + ["heading"," foo"], + ["empty",""] +],[ + ["empty","paragraph","start","markdown"], + ["markup.heading.2"," ##"], + ["heading"," foo"], + ["empty",""] +],[ + ["empty","paragraph","start","markdown"], + ["markup.heading.1"," #"], + ["heading"," foo"], + ["empty",""] +],[ + ["empty","start","start","markdown"], + ["empty",""] ],[ "start", - ["text.xml","test: 6+ #s is not a valid header"] + ["text","\u0000 test 39"] +],[ + ["empty","start","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," # foo"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] ],[ "start", - ["text.xml","####### foo"] + ["text","\u0000 test 40"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","foo"] +],[ + ["text","paragraph","markdown"], + ["text"," # bar"] +],[ + ["empty","start","markdown"], + ["empty",""] ],[ "start", - ["text.xml","test: # followed be only space is a valid header"] + ["text","\u0000 test 41"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], + ["markup.heading.2","##"], + ["heading"," foo ##"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], + ["markup.heading.3"," ###"], + ["heading"," bar ###"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] ],[ "start", + ["text","\u0000 test 42"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], ["markup.heading.1","#"], - ["heading"," "] + ["heading"," foo ##################################"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], + ["markup.heading.5","#####"], + ["heading"," foo ##"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 43"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], + ["markup.heading.3","###"], + ["heading"," foo ###"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] ],[ "start", - ["text.xml","test: only space between #s is a valid header"] + ["text","\u0000 test 44"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], + ["markup.heading.3","###"], + ["heading"," foo ### b"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] ],[ "start", + ["text","\u0000 test 45"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], ["markup.heading.1","#"], - ["heading"," #"] + ["heading"," foo#"], + ["empty",""] ],[ - "allowBlock" + ["empty","start","markdown"], + ["empty",""] ],[ "start", + ["text","\u0000 test 46"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], + ["markup.heading.3","###"], + ["heading"," foo "], + ["constant.language.escape","\\#"], + ["heading","##"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], + ["markup.heading.2","##"], + ["heading"," foo #"], + ["constant.language.escape","\\#"], + ["heading","#"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], ["markup.heading.1","#"], - ["heading"," test links "], - ["text","["], - ["string","Cloud9 IDE"], - ["text","]("], - ["markup.underline","http://www.c9.io/"], - ["text",")"], - ["heading"," #"] + ["heading"," foo "], + ["constant.language.escape","\\#"], + ["empty",""] ],[ - "listblock", - ["markup.list","* "], - ["text","["], - ["string","demo"], - ["text","]("], - ["markup.underline","http://ajaxorg.github.com/ace/"], - ["text",")"], - ["list"," "], - ["text","["], - ["string","+"], - ["text","]("], - ["markup.underline","escape(\\) "], - ["text",")"], - ["list"," "], - ["text","["], - ["string","+"], - ["text","]("], - ["markup.underline","a"], - ["string"," \"title\""], - ["text",")"], - ["list"," "], - ["text","["], - ["string","+"], - ["text","]("], - ["markup.underline","a"], - ["string"," \"space\" "], - ["text",")"] + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 47"] ],[ - "listblock", - ["markup.list","* "], - ["list","usually "], - ["string.emphasis","*work*"], - ["list"," fine ("], - ["string.emphasis","_em_"], - ["list",")"] + ["empty","start","markdown"], + ["empty",""] ],[ - "listblock", - ["list","in lists"] + ["constant","start","markdown"], + ["constant","****"] ],[ - "start" + ["empty","paragraph","markdown"], + ["markup.heading.2","##"], + ["heading"," foo"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant","****"] +],[ + ["empty","start","markdown"], + ["empty",""] ],[ "start", - ["text.xml","in plain text "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","b"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","http://ace.ajaxorg.com"], + ["text","\u0000 test 48"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Foo bar"] +],[ + ["empty","paragraph","markdown"], + ["markup.heading.1","#"], + ["heading"," baz"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Bar foo"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 49"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["markup.heading.2","header","paragraph","markdown"], + ["markup.heading.2","##"] +],[ + ["empty","paragraph","markdown"], + ["heading","#"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], + ["markup.heading.3","###"], + ["heading"," ###"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 50"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], + ["text","Foo "], + ["string.emphasis","*bar*"], + ["empty",""] +],[ + ["markup.heading.1","start","markdown"], + ["markup.heading.1","========="] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], + ["text","Foo "], + ["string.emphasis","*bar*"], + ["empty",""] +],[ + ["markup.heading.2","start","markdown"], + ["markup.heading.2","---------"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 51"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["string.emphasis","emphasisState","paragraph","markdown"], + ["text","Foo "], + ["string.emphasis","*bar"] +],[ + ["empty","paragraph","markdown"], + ["string.emphasis","baz*"], + ["empty",""] +],[ + ["markup.heading.1","start","markdown"], + ["markup.heading.1","===="] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 52"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["string.emphasis","emphasisState","paragraph","markdown"], + ["text"," Foo "], + ["string.emphasis","*bar"] +],[ + ["text","paragraph","markdown"], + ["string.emphasis","baz*"], + ["text"," "] +],[ + ["markup.heading.1","start","markdown"], + ["markup.heading.1","===="] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 53"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Foo"] +],[ + ["markup.heading.2","start","markdown"], + ["markup.heading.2","-------------------------"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Foo"] +],[ + ["markup.heading.1","start","markdown"], + ["markup.heading.1","="] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 54"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text"," Foo"] +],[ + ["markup.heading.2","start","markdown"], + ["markup.heading.2","---"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text"," Foo"] +],[ + ["markup.heading.2","start","markdown"], + ["markup.heading.2","-----"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text"," Foo"] +],[ + ["markup.heading.1","start","markdown"], + ["markup.heading.1"," ==="] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 55"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," Foo"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," ---"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," Foo"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant","---"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 56"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Foo"] +],[ + ["markup.heading.2","start","markdown"], + ["markup.heading.2"," ----"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 57"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Foo"] +],[ + ["text","paragraph","markdown"], + ["text"," ---"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 58"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Foo"] +],[ + ["text","paragraph","markdown"], + ["text","= ="] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Foo"] +],[ + ["constant","start","markdown"], + ["constant","--- -"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 59"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Foo"] +],[ + ["markup.heading.2","start","markdown"], + ["markup.heading.2","-----"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 60"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Foo\\"] +],[ + ["markup.heading.2","start","markdown"], + ["markup.heading.2","----"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 61 (not supported Setex headers)"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","`Foo"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","----"] +],[ + ["support.function","paragraph","markdown"], + ["support.function","`"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["entity.other.attribute-name.xml","tag_stuff","markdown"], ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","b"], - ["meta.tag.punctuation.tag-close.xml",">"] + ["meta.tag.anchor.tag-name.xml","a"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","title"], + ["keyword.operator.attribute-equals.xml","="], + ["text","\""], + ["entity.other.attribute-name.xml","a"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","lot"] +],[ + ["entity.other.attribute-name.xml","tag_stuff","markdown"], + ["entity.other.attribute-name.xml","---"] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["entity.other.attribute-name.xml","of"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","dashes"], + ["text","\""], + ["meta.tag.punctuation.tag-close.xml","/>"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 62"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["string.blockquote","blockquote","markdown"], + ["string.blockquote","> Foo"] +],[ + ["constant","start","markdown"], + ["constant","---"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 63"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["string.blockquote","blockquote","markdown"], + ["string.blockquote","> foo"] +],[ + ["string.blockquote","blockquote","markdown"], + ["string.blockquote","bar"] +],[ + ["string.blockquote","blockquote","markdown"], + ["string.blockquote","==="] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 64"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","lineStart","listBlock","start","markdown"], + ["markup.list.2","- "], + ["list","Foo"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant","---"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 65"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Foo"] +],[ + ["text","paragraph","markdown"], + ["text","Bar"] +],[ + ["markup.heading.2","start","markdown"], + ["markup.heading.2","---"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 66"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant","---"] +],[ + ["text","paragraph","markdown"], + ["text","Foo"] +],[ + ["markup.heading.2","start","markdown"], + ["markup.heading.2","---"] +],[ + ["text","paragraph","markdown"], + ["text","Bar"] +],[ + ["markup.heading.2","start","markdown"], + ["markup.heading.2","---"] +],[ + ["text","paragraph","markdown"], + ["text","Baz"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 67"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["markup.heading.1","start","markdown"], + ["markup.heading.1","===="] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 68"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant","---"] +],[ + ["constant","start","markdown"], + ["constant","---"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 69"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","lineStart","listBlock","start","markdown"], + ["markup.list.2","- "], + ["list","foo"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant","-----"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 70"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," foo"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant","---"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 71"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["string.blockquote","blockquote","markdown"], + ["string.blockquote","> foo"] +],[ + ["constant","start","markdown"], + ["constant","-----"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 72"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["constant.language.escape","\\>"], + ["text"," foo"] +],[ + ["markup.heading.2","start","markdown"], + ["markup.heading.2","------"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 73"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Foo"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","bar"] +],[ + ["markup.heading.2","start","markdown"], + ["markup.heading.2","---"] +],[ + ["text","paragraph","markdown"], + ["text","baz"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 74"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Foo"] +],[ + ["text","paragraph","markdown"], + ["text","bar"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant","---"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","baz"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 75"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Foo"] +],[ + ["text","paragraph","markdown"], + ["text","bar"] +],[ + ["constant","start","markdown"], + ["constant","* * *"] +],[ + ["text","paragraph","markdown"], + ["text","baz"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 76"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Foo"] +],[ + ["text","paragraph","markdown"], + ["text","bar"] +],[ + ["text","paragraph","markdown"], + ["constant.language.escape","\\-"], + ["text","--"] +],[ + ["text","paragraph","markdown"], + ["text","baz"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 77"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," a simple"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," indented code block"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 78"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","lineStart","listBlock","start","markdown"], + ["markup.list.4"," - "], + ["list","foo"], + ["empty",""] +],[ + ["empty","lineStart","listBlockEmpty","listBlock","start","markdown"], + ["empty",""] +],[ + ["empty","lineStart","listBlock","start","markdown"], + ["indent"," "], + ["list","bar"], + ["empty",""] +],[ + ["empty","lineStart","listBlockEmpty","listBlock","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 79"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","lineStart","listBlock","start","markdown"], + ["markup.list.4","1. "], + ["list","foo"], + ["empty",""] +],[ + ["empty","lineStart","listBlockEmpty","listBlock","start","markdown"], + ["empty",""] +],[ + ["empty","lineStart","listBlock","lineStart","listBlockEmpty","listBlock","start","markdown"], + ["indent"," "], + ["markup.list.6","- "], + ["list","bar"], + ["empty",""] +],[ + ["empty","lineStart","listBlockEmpty","listBlock","lineStart","listBlockEmpty","listBlock","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 80"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," "], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," *hi*"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," - one"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 81"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," chunk1"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," chunk2"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," chunk3"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 82"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," chunk1"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," chunk2"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 83"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","Foo"] +],[ + ["text","paragraph","markdown"], + ["text"," bar"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 84"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," foo"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","bar"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 85"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], + ["markup.heading.1","#"], + ["heading"," Heading"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text"," foo"] +],[ + ["text","paragraph","markdown"], + ["text","Heading"] +],[ + ["markup.heading.2","start","markdown"], + ["markup.heading.2","------"] +],[ + ["empty","start","markdown"], + ["support.function"," foo"], + ["empty",""] +],[ + ["constant","start","markdown"], + ["constant","----"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 86"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," foo"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," bar"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 87"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," foo"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 88"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["support.function"," foo"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 89"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","```"] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","<"] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function"," >"] +],[ + ["support.function","start","markdown"], + ["support.function","```"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 90"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","~~~"] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","<"] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function"," >"] +],[ + ["support.function","start","markdown"], + ["support.function","~~~"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 91"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","``"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","foo"] +],[ + ["support.function","paragraph","markdown"], + ["support.function","``"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 92"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","```"] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","aaa"] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","~~~"] +],[ + ["support.function","start","markdown"], + ["support.function","```"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 93"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","~~~"] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","aaa"] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","```"] +],[ + ["support.function","start","markdown"], + ["support.function","~~~"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 94"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","````"] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","aaa"] +],[ + ["support.function","start","markdown"], + ["support.function","```"] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","``````"] +],[ + ["empty","githubblock","codeBlock","start","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 95"] +],[ + ["empty","githubblock","codeBlock","start","markdown"], + ["empty",""] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","~~~~"] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","aaa"] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","~~~"] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","~~~~"] +],[ + ["empty","githubblock","codeBlock","start","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 96"] +],[ + ["empty","githubblock","codeBlock","start","markdown"], + ["empty",""] +],[ + ["support.function","start","markdown"], + ["support.function","```"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 97"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","`````"] +],[ + ["empty","githubblock","codeBlock","start","markdown"], + ["empty",""] +],[ + ["support.function","start","markdown"], + ["support.function","```"] +],[ + ["text","paragraph","markdown"], + ["text","aaa"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 98 (not supported; high complexity in realization, because if each line starts with > , then it should be normal code block (needs to treat > as whitespace))"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["support.function","githubblock","codeBlock","blockquote","markdown"], + ["string.blockquote",">"], + ["support.function"," ```"] +],[ + ["support.function","githubblock","codeBlock","blockquote","markdown"], + ["support.function","> aaa"] +],[ + ["empty","githubblock","codeBlock","blockquote","markdown"], + ["empty",""] +],[ + ["support.function","githubblock","codeBlock","blockquote","markdown"], + ["support.function","bbb"] +],[ + ["empty","githubblock","codeBlock","blockquote","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 99"] +],[ + ["empty","githubblock","codeBlock","blockquote","markdown"], + ["empty",""] +],[ + ["support.function","blockquote","markdown"], + ["support.function","```"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","```"] +],[ + ["empty","githubblock","codeBlock","start","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 100"] +],[ + ["empty","githubblock","codeBlock","start","markdown"], + ["empty",""] +],[ + ["support.function","start","markdown"], + ["support.function","```"] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","```"] +],[ + ["empty","githubblock","codeBlock","start","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 101"] +],[ + ["empty","githubblock","codeBlock","start","markdown"], + ["empty",""] +],[ + ["support.function","start","markdown"], + ["support.function"," ```"] +],[ + ["text","paragraph","markdown"], + ["text"," aaa"] +],[ + ["text","paragraph","markdown"], + ["text","aaa"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","```"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 102"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + ["support.function","paragraph","markdown"], + ["support.function"," "], + ["support.function","```"] +],[ + ["text","paragraph","markdown"], + ["text","aaa"] +],[ + ["text","paragraph","markdown"], + ["text"," aaa"] +],[ + ["text","paragraph","markdown"], + ["text","aaa"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["text"," "], + ["support.function","```"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 103"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + ["support.function","paragraph","markdown"], + ["support.function"," "], + ["support.function","```"] +],[ + ["text","paragraph","markdown"], + ["text"," aaa"] +],[ + ["text","paragraph","markdown"], + ["text"," aaa"] +],[ + ["text","paragraph","markdown"], + ["text"," aaa"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["text"," "], + ["support.function","```"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 104"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + ["support.function","paragraph","markdown"], + ["support.function"," "], + ["support.function","```"] +],[ + ["text","paragraph","markdown"], + ["text"," aaa"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["text"," "], + ["support.function","```"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 105"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + ["support.function","paragraph","markdown"], + ["support.function","```"] +],[ + ["text","paragraph","markdown"], + ["text","aaa"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["text"," "], + ["support.function","```"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 106"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + ["support.function","paragraph","markdown"], + ["support.function"," "], + ["support.function","```"] +],[ + ["text","paragraph","markdown"], + ["text","aaa"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["text"," "], + ["support.function","```"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 107"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + ["support.function","paragraph","markdown"], + ["support.function","```"] +],[ + ["text","paragraph","markdown"], + ["text","aaa"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["text"," "], + ["support.function","```"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 108"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","```"], + ["text"," "], + ["support.function","```"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","aaa"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 109"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","~~~~~~"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","aaa"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","~~~ ~~"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 110"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","foo"] +],[ + ["support.function","paragraph","markdown"], + ["support.function","```"] +],[ + ["text","paragraph","markdown"], + ["text","bar"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","```"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","baz"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 111"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","foo"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","---"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","~~~"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","bar"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","~~~"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","# baz"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 112"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["support.function","```"], + ["text","ruby"] +],[ + ["text","paragraph","markdown"], + ["text","def foo(x)"] +],[ + ["text","paragraph","markdown"], + ["text"," return 3"] +],[ + ["text","paragraph","markdown"], + ["text","end"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","```"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 113"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","~~~~ ruby startline=3 $%@#$"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","def foo(x)"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function"," return 3"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","end"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","~~~~~~~"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 114"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","````;"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","````"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 115"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","```"], + ["text"," aa "], + ["support.function","```"] +],[ + ["support.function","codeSpan","paragraph","markdown"], + ["support.function","foo"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + "start", + ["support.function","\u0000 test 116"] +],[ + ["empty","codeSpan","paragraph","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["support.function","~~~ aa "], + ["support.function","```"], + ["text"," ~~~"] +],[ + ["text","paragraph","markdown"], + ["text","foo"] +],[ + ["text","paragraph","markdown"], + ["text","~~~"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 117"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","```"] +],[ + ["support.function","githubblock","codeBlock","start","markdown"], + ["support.function","``` aaa"] +],[ + ["support.function","start","markdown"], + ["support.function","```"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 118"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.table.tag-name.xml","table"], + ["meta.tag.punctuation.tag-close.xml",">"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.table.tag-name.xml","tr"], + ["meta.tag.punctuation.tag-close.xml",">"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.table.tag-name.xml","td"], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["meta.tag.punctuation.tag-close.xml","innerTagSpace","html","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","pre"], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["text","innerTagSpace","html","markdown"], + ["text","**Hello**,"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["string.emphasis","_world_"], + ["text","."] +],[ + ["meta.tag.punctuation.tag-close.xml","paragraph","markdown"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["meta.tag.punctuation.tag-close.xml","paragraph","markdown"], + ["meta.tag.punctuation.end-tag-open.xml",""], + ["meta.tag.punctuation.end-tag-open.xml",""], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 119"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.table.tag-name.xml","table"], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["text"," "], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.table.tag-name.xml","tr"], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["text"," "], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.table.tag-name.xml","td"], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["text","html","markdown"], + ["text"," hi"] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["text"," "], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["text"," "], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","paragraph","markdown"], + ["text","okay."] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 120"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["indent"," "], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","div"], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["text","html","markdown"], + ["text"," *hello*"] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["text"," "], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","foo"], + ["meta.tag.punctuation.tag-close.xml",">"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.anchor.tag-name.xml","a"], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 121"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["text","html","markdown"], + ["text","*foo*"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 122"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","DIV"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","CLASS"], + ["keyword.operator.attribute-equals.xml","="], + ["text","\""], + ["entity.other.attribute-name.xml","foo"], + ["text","\""], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], + ["string.emphasis","*Markdown*"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 123"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","tag_stuff","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","div"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","id"], + ["keyword.operator.attribute-equals.xml","="], + ["text","\""], + ["entity.other.attribute-name.xml","foo"], + ["text","\""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","class"], + ["keyword.operator.attribute-equals.xml","="], + ["text","\""], + ["entity.other.attribute-name.xml","bar"], + ["text","\""], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 124"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["entity.other.attribute-name.xml","tag_stuff","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","div"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","id"], + ["keyword.operator.attribute-equals.xml","="], + ["text","\""], + ["entity.other.attribute-name.xml","foo"], + ["text","\""], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","class"], + ["keyword.operator.attribute-equals.xml","="], + ["text","\""], + ["entity.other.attribute-name.xml","bar"] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","baz"], + ["text","\""], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 125"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","div"], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["text","html","markdown"], + ["text","*foo*"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], + ["string.emphasis","*bar*"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 126"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","tag_stuff","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","div"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","id"], + ["keyword.operator.attribute-equals.xml","="], + ["text","\""], + ["entity.other.attribute-name.xml","foo"], + ["text","\""] +],[ + ["text","tag_stuff","markdown"], + ["text","*"], + ["entity.other.attribute-name.xml","hi"], + ["text","*"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 127"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["entity.other.attribute-name.xml","tag_stuff","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","div"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","class"] +],[ + ["entity.other.attribute-name.xml","tag_stuff","markdown"], + ["entity.other.attribute-name.xml","foo"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 128"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["entity.other.attribute-name.xml","tag_stuff","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","div"], + ["text.tag-whitespace.xml"," "], + ["text","*???"], + ["entity.other.attribute-name.xml","-"], + ["text","&&&"], + ["entity.other.attribute-name.xml","-"], + ["text","<"], + ["entity.other.attribute-name.xml","---"] +],[ + ["text","tag_stuff","markdown"], + ["text","*"], + ["entity.other.attribute-name.xml","foo"], + ["text","*"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 129"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","div"], + ["meta.tag.punctuation.tag-close.xml",">"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.anchor.tag-name.xml","a"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","href"], + ["keyword.operator.attribute-equals.xml","="], + ["text","\""], + ["entity.other.attribute-name.xml","bar"], + ["text","\""], + ["meta.tag.punctuation.tag-close.xml",">"], + ["text","*foo*"], + ["meta.tag.punctuation.end-tag-open.xml",""], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 130"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.table.tag-name.xml","table"], + ["meta.tag.punctuation.tag-close.xml",">"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.table.tag-name.xml","tr"], + ["meta.tag.punctuation.tag-close.xml",">"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.table.tag-name.xml","td"], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["text","html","markdown"], + ["text","foo"] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.end-tag-open.xml",""], + ["meta.tag.punctuation.end-tag-open.xml",""], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 131"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","div"], + ["meta.tag.punctuation.tag-close.xml",">"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["text","html","markdown"], + ["text","``` c"] +],[ + ["text","html","markdown"], + ["text","int x = 33;"] +],[ + ["text","html","markdown"], + ["text","```"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 132"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.anchor.tag-name.xml","a"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","href"], + ["keyword.operator.attribute-equals.xml","="], + ["text","\""], + ["entity.other.attribute-name.xml","foo"], + ["text","\""], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["text","html","markdown"], + ["text","*bar*"] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 133"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","Warning"], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["text","html","markdown"], + ["text","*bar*"] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 134"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","i"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","class"], + ["keyword.operator.attribute-equals.xml","="], + ["text","\""], + ["entity.other.attribute-name.xml","foo"], + ["text","\""], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["text","html","markdown"], + ["text","*bar*"] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 135"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["text","html","markdown"], + ["text","*bar*"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 136"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","del"], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["text","html","markdown"], + ["text","*foo*"] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 137"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","del"], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["empty","paragraph","markdown"], + ["string.emphasis","*foo*"], + ["empty",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 138"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","html","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","del"], + ["meta.tag.punctuation.tag-close.xml",">"], + ["text","*foo*"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 139"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["text","innerTagSpace","html","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","pre"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","language"], + ["keyword.operator.attribute-equals.xml","="], + ["text","\""], + ["entity.other.attribute-name.xml","haskell"], + ["text","\""], + ["meta.tag.punctuation.tag-close.xml",">"], + ["text",""] +],[ + ["text","innerTagSpace","html","markdown"], + ["text","import Text.HTML.TagSoup"] +],[ + ["empty","innerTagSpace","html","markdown"], + ["empty",""] +],[ + ["text","innerTagSpace","html","markdown"], + ["text","main :: IO ()"] +],[ + ["text","innerTagSpace","html","markdown"], + ["text","main = print $ parseTags tags"] +],[ + ["meta.tag.punctuation.tag-close.xml","start","markdown"], + ["text",""], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["text","paragraph","markdown"], + ["text","okay"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 140"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","innerTagSpace","html","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","script"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","type"], + ["keyword.operator.attribute-equals.xml","="], + ["text","\""], + ["entity.other.attribute-name.xml","text"], + ["text","/"], + ["entity.other.attribute-name.xml","javascript"], + ["text","\""], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["text","innerTagSpace","html","markdown"], + ["text","// JavaScript example"] +],[ + ["empty","innerTagSpace","html","markdown"], + ["empty",""] +],[ + ["text","innerTagSpace","html","markdown"], + ["text","document.getElementById(\"demo\").innerHTML = \"Hello JavaScript!\";"] +],[ + ["meta.tag.punctuation.tag-close.xml","start","markdown"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["text","paragraph","markdown"], + ["text","okay"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 141"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.tag-name.xml","tag_stuff","innerTagSpace","html","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","style"] +],[ + ["meta.tag.punctuation.tag-close.xml","innerTagSpace","html","markdown"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","type"], + ["keyword.operator.attribute-equals.xml","="], + ["text","\""], + ["entity.other.attribute-name.xml","text"], + ["text","/"], + ["entity.other.attribute-name.xml","css"], + ["text","\""], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["text","innerTagSpace","html","markdown"], + ["text","h1 {color:red;}"] +],[ + ["empty","innerTagSpace","html","markdown"], + ["empty",""] +],[ + ["text","innerTagSpace","html","markdown"], + ["text","p {color:blue;}"] +],[ + ["meta.tag.punctuation.tag-close.xml","start","markdown"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + ["text","paragraph","markdown"], + ["text","okay"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 142"] +],[ + ["empty","start","markdown"], + ["empty",""] +],[ + ["meta.tag.tag-name.xml","tag_stuff","innerTagSpace","html","markdown"], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","style"] +],[ + ["meta.tag.punctuation.tag-close.xml","innerTagSpace","html","markdown"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","type"], + ["keyword.operator.attribute-equals.xml","="], + ["text","\""], + ["entity.other.attribute-name.xml","text"], + ["text","/"], + ["entity.other.attribute-name.xml","css"], + ["text","\""], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + ["empty","innerTagSpace","html","markdown"], + ["empty",""] +],[ + ["text","innerTagSpace","html","markdown"], + ["text","foo"] +],[ + ["empty","innerTagSpace","html","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 143"] +],[ + ["empty","innerTagSpace","html","markdown"], + ["empty",""] +],[ + ["text","innerTagSpace","html","markdown"], + ["text",">
"] +],[ + ["text","innerTagSpace","html","markdown"], + ["text","> foo"] +],[ + ["empty","innerTagSpace","html","markdown"], + ["empty",""] +],[ + ["text","innerTagSpace","html","markdown"], + ["text","bar"] +],[ + ["empty","innerTagSpace","html","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 144"] +],[ + ["empty","innerTagSpace","html","markdown"], + ["empty",""] +],[ + ["text","innerTagSpace","html","markdown"], + ["text","-
"] +],[ + ["text","innerTagSpace","html","markdown"], + ["text","- foo"] +],[ + ["empty","innerTagSpace","html","markdown"], + ["empty",""] +],[ + "start", + ["text","\u0000 test 145"] +],[ + ["empty","innerTagSpace","html","markdown"], + ["empty",""] +],[ + ["meta.tag.punctuation.tag-close.xml","start","markdown"], + ["text","