@cosense-toolbox/textmate 0.1.0-beta.5 → 0.1.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +25 -10
- package/dist/index.mjs.map +1 -1
- package/grammars/cosense-x.tmLanguage.json +60 -49
- package/grammars/cosense.tmLanguage.json +60 -49
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
> **beta.** スコープ名はまだ変わりえます。安定するまではバージョン固定での利用を推奨します。
|
|
4
4
|
|
|
5
|
-
Cosense
|
|
6
|
-
Shiki の `LanguageRegistration`
|
|
5
|
+
Cosense 記法に対応する TextMate 文法です。`.csn` 用の `cosense` と、コンポーネント行も認識する `.csnx` 用の `cosenseX` を提供します。
|
|
6
|
+
Shiki の `LanguageRegistration` として使えるほか、`.tmLanguage.json` も同梱しています。
|
|
7
|
+
|
|
8
|
+
**ドキュメント → <https://cosense-toolbox.qaynam.dev/textmate/>**
|
|
7
9
|
|
|
8
10
|
```sh
|
|
9
11
|
npm i @cosense-toolbox/textmate
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/grammar.ts","../src/scopes.ts","../src/index.ts"],"mappings":";;UAoBiB;EACf;EACA;EACA;EACA;EACA,WAAW,eAAe;EAC1B,gBAAgB,eAAe;EAC/B,cAAc,eAAe;EAC7B,WAAW;EACX;EACA;;;UAIe;EACf,MAAM;EACN;EACA,mBAAmB;EACnB;EACA;EACA,UAAU;EACV,YAAY,eAAe;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/grammar.ts","../src/scopes.ts","../src/index.ts"],"mappings":";;UAoBiB;EACf;EACA;EACA;EACA;EACA,WAAW,eAAe;EAC1B,gBAAgB,eAAe;EAC/B,cAAc,eAAe;EAC7B,WAAW;EACX;EACA;;;UAIe;EACf,MAAM;EACN;EACA,mBAAmB;EACnB;EACA;EACA,UAAU;EACV,YAAY,eAAe;;;KA4ejB;;;;;;;;;;;cCvgBC;;;;;;;;;;;;;;;;;;;;;;;;;KA+BD,wBAAwB;;;cClCvB,SAAS;cAET,UAAU"}
|
package/dist/index.mjs
CHANGED
|
@@ -68,6 +68,16 @@ const IMAGE_URL = oneOf([
|
|
|
68
68
|
const URL = re`(?i:https?)://[^\s\[\]]+`;
|
|
69
69
|
/** What a bracket must end with somewhere, or it is plain text and not worth a rule. */
|
|
70
70
|
const CLOSES = re`(?=.*\])`;
|
|
71
|
+
/**
|
|
72
|
+
* No inline code starts inside the bracket that opens here. Cosense reads code before
|
|
73
|
+
* brackets, so a bracket with a code span starting inside it is no notation (`[a `b` c]`).
|
|
74
|
+
* A span starts at a backtick with another one anywhere after it. One level of brackets is
|
|
75
|
+
* stepped over, as emphasis holds them (`[* a [b] `c`]`). The backtick is written `\x60`,
|
|
76
|
+
* which both regex engines read the same.
|
|
77
|
+
*/
|
|
78
|
+
const NO_CODE_INSIDE = re`(?!(?:\[[^\[\]]*\]|[^\]\x60])*\x60.*\x60)`;
|
|
79
|
+
/** The same for `[[x]]`, which closes on the first `]]`. */
|
|
80
|
+
const NO_CODE_INSIDE_DOUBLE = re`(?!(?:(?!\]\])[^\x60])*\x60.*\x60)`;
|
|
71
81
|
/** A bracket closes on its own line or not at all. */
|
|
72
82
|
const CLOSE_ON_LINE = re`\]|(?=$)`;
|
|
73
83
|
/**
|
|
@@ -165,21 +175,24 @@ const markerConditions = (emphasis) => Regex([
|
|
|
165
175
|
*/
|
|
166
176
|
const emphasisRules = Array.map(MARKER_SETS, (emphasis) => region({
|
|
167
177
|
scopes: emphasisScopes(emphasis),
|
|
168
|
-
begin: re`\[${markerConditions(emphasis)}(?=${MARKERS}+\s.*\])${MARKERS}+\s+`,
|
|
178
|
+
begin: re`\[${NO_CODE_INSIDE}${markerConditions(emphasis)}(?=${MARKERS}+\s.*\])${MARKERS}+\s+`,
|
|
169
179
|
end: CLOSE_ON_LINE,
|
|
170
180
|
patterns: [include("inline-in-emphasis"), include("nested-bracket")]
|
|
171
181
|
}));
|
|
172
182
|
/** Anything up to, but not over, a `]]`. */
|
|
173
183
|
const UNTIL_DOUBLE_CLOSE = re`(?:(?!\]\]).)`;
|
|
174
184
|
/** `[[x]]`: an image when x is one, bold otherwise. Closes on the first `]]`, depth or not. */
|
|
175
|
-
const strongRules = [single(re`\[\[(?:${IMAGE_URL}|${UNTIL_DOUBLE_CLOSE}*?${IMAGE_EXT}(?:[?#]${UNTIL_DOUBLE_CLOSE}*)?)\]\]`, { scopes: [SCOPES.image] }), single(re`\[\[(${UNTIL_DOUBLE_CLOSE}+)\]\]`, {
|
|
185
|
+
const strongRules = [single(re`\[\[${NO_CODE_INSIDE_DOUBLE}(?:${IMAGE_URL}|${UNTIL_DOUBLE_CLOSE}*?${IMAGE_EXT}(?:[?#]${UNTIL_DOUBLE_CLOSE}*)?)\]\]`, { scopes: [SCOPES.image] }), single(re`\[\[${NO_CODE_INSIDE_DOUBLE}(${UNTIL_DOUBLE_CLOSE}+)\]\]`, {
|
|
176
186
|
scopes: [SCOPES.bold],
|
|
177
187
|
captures: { 1: readAs(include("inline-in-emphasis")) }
|
|
178
188
|
})];
|
|
179
|
-
/**
|
|
189
|
+
/**
|
|
190
|
+
* `[$ x^2]`. Its body is TeX, not notation, and may hold brackets of its own. Like any
|
|
191
|
+
* bracket, it is no formula when inline code starts inside it (`[$ a``]`).
|
|
192
|
+
*/
|
|
180
193
|
const formulaRule = region({
|
|
181
194
|
scopes: [SCOPES.formula],
|
|
182
|
-
begin: re`\[(?=\$)${CLOSES}`,
|
|
195
|
+
begin: re`\[${NO_CODE_INSIDE}(?=\$)${CLOSES}`,
|
|
183
196
|
end: CLOSE_ON_LINE,
|
|
184
197
|
patterns: [include("bare-bracket")]
|
|
185
198
|
});
|
|
@@ -188,12 +201,12 @@ const formulaRule = region({
|
|
|
188
201
|
* URL before an image path before a project link, and anything left is a page link.
|
|
189
202
|
*/
|
|
190
203
|
const simpleTargetRules = (allowImagePath) => Array.getSomes([
|
|
191
|
-
Option.some(single(re`\[[^\[\]]+\.icon(?:\*\d+)?\]`, { scopes: [SCOPES.icon] })),
|
|
192
|
-
Option.some(single(re`\[\s*(?:${URL}\s+)*(?:${IMAGE_URL})(?=[\s\]])(?:\s+${URL})*\s*\]`, { scopes: [SCOPES.image] })),
|
|
193
|
-
Option.some(single(re`\[[^\[\]]*${URL}[^\[\]]*\]`, { scopes: [SCOPES.externalLink] })),
|
|
194
|
-
onlyIf(allowImagePath, single(re`\[[^\[\]]*${IMAGE_EXT}\]`, { scopes: [SCOPES.image] })),
|
|
195
|
-
Option.some(single(re`\[/[^\[\]]*\]`, { scopes: [SCOPES.projectLink] })),
|
|
196
|
-
Option.some(single(re`\[(?=[^\[\]]*[^\s\[\]])[^\[\]]+\]`, { scopes: [SCOPES.link] }))
|
|
204
|
+
Option.some(single(re`\[${NO_CODE_INSIDE}[^\[\]]+\.icon(?:\*\d+)?\]`, { scopes: [SCOPES.icon] })),
|
|
205
|
+
Option.some(single(re`\[${NO_CODE_INSIDE}\s*(?:${URL}\s+)*(?:${IMAGE_URL})(?=[\s\]])(?:\s+${URL})*\s*\]`, { scopes: [SCOPES.image] })),
|
|
206
|
+
Option.some(single(re`\[${NO_CODE_INSIDE}[^\[\]]*${URL}[^\[\]]*\]`, { scopes: [SCOPES.externalLink] })),
|
|
207
|
+
onlyIf(allowImagePath, single(re`\[${NO_CODE_INSIDE}[^\[\]]*${IMAGE_EXT}\]`, { scopes: [SCOPES.image] })),
|
|
208
|
+
Option.some(single(re`\[${NO_CODE_INSIDE}/[^\[\]]*\]`, { scopes: [SCOPES.projectLink] })),
|
|
209
|
+
Option.some(single(re`\[${NO_CODE_INSIDE}(?=[^\[\]]*[^\s\[\]])[^\[\]]+\]`, { scopes: [SCOPES.link] }))
|
|
197
210
|
]);
|
|
198
211
|
/** What follows the bracketed notation in both contexts, in the parser's order. */
|
|
199
212
|
const unbracketedRules = [
|
|
@@ -273,6 +286,7 @@ const REPOSITORY = {
|
|
|
273
286
|
single(re`\b(?:true|false|null|undefined)\b`, { scopes: ["constant.language.cosense"] })
|
|
274
287
|
]
|
|
275
288
|
}),
|
|
289
|
+
command: single(re`^${INDENT}([$%] .+)$`, { captures: { 1: scoped(SCOPES.code) } }),
|
|
276
290
|
quote: region({
|
|
277
291
|
scopes: ["markup.quote.cosense"],
|
|
278
292
|
begin: re`^${INDENT}(>[> ]*)`,
|
|
@@ -348,6 +362,7 @@ const linePatterns = (dialect) => Array.getSomes([
|
|
|
348
362
|
Option.some(include("code-block")),
|
|
349
363
|
Option.some(include("table-block")),
|
|
350
364
|
onlyIf(dialect.components, include("component")),
|
|
365
|
+
Option.some(include("command")),
|
|
351
366
|
Option.some(include("quote")),
|
|
352
367
|
Option.some(include("inline"))
|
|
353
368
|
]);
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["Arr","Rec"],"sources":["../src/scopes.ts","../src/grammar.ts","../src/index.ts"],"sourcesContent":["/**\n * A scope this grammar gives. Every one ends in `.cosense`, which is how a theme or a\n * reader tells them from the scopes of a language embedded next to Cosense.\n */\nexport type Scope = `${string}.cosense`\n\n/**\n * The TextMate scope each Cosense notation is drawn as.\n *\n * Keys are the token names @cosense-toolbox/lsp reasons in, so the two\n * highlighters describe the same things; the parity test holds them to it. Each scope\n * starts with a name themes already colour (`markup.bold`, `string.other.link`, ...), so\n * any Shiki or VS Code theme draws Cosense without knowing about it.\n */\nexport const SCOPES = {\n title: \"markup.heading.cosense\",\n link: \"string.other.link.internal.cosense\",\n projectLink: \"string.other.link.project.cosense\",\n externalLink: \"markup.underline.link.external.cosense\",\n hashtag: \"entity.name.tag.hashtag.cosense\",\n code: \"markup.inline.raw.cosense\",\n codeBlock: \"markup.raw.block.cosense\",\n formula: \"constant.other.formula.cosense\",\n icon: \"string.other.link.icon.cosense\",\n // Only the `>` marker, as the language server marks it. The whole line also carries\n // `markup.quote.cosense` so themes can tint it.\n quote: \"punctuation.definition.quote.begin.cosense\",\n bold: \"markup.bold.cosense\",\n italic: \"markup.italic.cosense\",\n strike: \"markup.strikethrough.cosense\",\n underline: \"markup.underline.cosense\",\n image: \"markup.underline.link.image.cosense\",\n table: \"markup.other.table.cosense\",\n // `[** x]` and louder: still bold to a theme, but a level apart for anyone who wants it.\n bold2: \"markup.bold.level2.cosense\",\n bold3: \"markup.bold.level3.cosense\",\n // `.csnx` only: the tag that opens a component line, read as JSX. The whole line also\n // carries `meta.tag.component.cosense`.\n component: \"support.class.component.cosense\",\n attribute: \"entity.other.attribute-name.cosense\",\n attributeValue: \"string.quoted.attribute-value.cosense\",\n expression: \"meta.embedded.expression.cosense\",\n frontmatter: \"comment.block.frontmatter.cosense\",\n} as const satisfies Record<string, Scope>\n\nexport type Notation = keyof typeof SCOPES\n","/**\n * The Cosense grammar, built from code rather than written as JSON: emphasis alone takes\n * one rule per combination of markers, and those are generated.\n *\n * The rules follow @cosense-toolbox/parser, and where they cannot (TextMate reads line by\n * line with regexes, the parser reads the whole page) they approximate it. The parity test\n * measures how close that is against the language server.\n *\n * Rules are first built as a tagged union (`Pattern`) and only then encoded as TextMate\n * JSON. The union is what keeps the grammar honest: a rule is a match or a region and never\n * half of each, every `include` names a repository entry that exists, and every scope ends\n * in `.cosense`. A typo in any of those fails to compile instead of silently colouring nothing.\n */\nimport { Array as Arr, Brand, Match, Option, pipe, Record as Rec } from \"effect\"\n\nimport { type Scope, SCOPES } from \"./scopes\"\n\n// --- The output: what Shiki and VS Code read ------------------------------------------\n\n/** A TextMate rule as JSON. Assignable to Shiki's and VS Code's own types. */\nexport interface Rule {\n name?: string\n match?: string\n begin?: string\n end?: string\n captures?: Record<string, Rule>\n beginCaptures?: Record<string, Rule>\n endCaptures?: Record<string, Rule>\n patterns?: Rule[]\n include?: string\n applyEndPatternLast?: boolean\n}\n\n/** A grammar as Shiki takes it (`LanguageRegistration`), which is also a `.tmLanguage.json`. */\nexport interface Grammar {\n name: Dialect\n displayName: string\n scopeName: `text.${Dialect}`\n aliases: string[]\n fileTypes: string[]\n patterns: Rule[]\n repository: Record<string, Rule>\n}\n\n// --- Regexes ----------------------------------------------------------------------------\n\n/** A regex in Oniguruma syntax. Branded so a scope or a label cannot be passed as one. */\ntype Regex = string & Brand.Brand<\"Regex\">\nconst Regex = Brand.nominal<Regex>()\n\n/** A regex written raw: backslashes are the regex's, not the string literal's. */\nconst re = (strings: TemplateStringsArray, ...parts: ReadonlyArray<Regex | number>): Regex =>\n Regex(String.raw(strings, ...parts))\n\nconst oneOf = (alternatives: Arr.NonEmptyReadonlyArray<Regex>): Regex =>\n Regex(alternatives.map((alternative) => `(?:${alternative})`).join(\"|\"))\n\n/** Indentation, as the parser counts it: full-width spaces (U+3000) indent too. */\nconst INDENT = re`[ \\t\\u3000]*`\n\nconst IMAGE_EXT = re`\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)`\n\n/**\n * A URL that is drawn as an image, inside a bracket (so without `[`, `]` or spaces):\n * a Gyazo page, a path ending in an image extension before any query, or a fragment\n * ending in one (`#.svg`, Cosense's way of saying \"this is an image\").\n */\nconst IMAGE_URL = oneOf([\n re`(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*`,\n re`(?i:https?)://[^\\s\\[\\]?#]*${IMAGE_EXT}(?:[?#][^\\s\\[\\]]*)?`,\n re`(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*${IMAGE_EXT}`,\n])\n\nconst URL = re`(?i:https?)://[^\\s\\[\\]]+`\n\n/** What a bracket must end with somewhere, or it is plain text and not worth a rule. */\nconst CLOSES = re`(?=.*\\])`\n\n/** A bracket closes on its own line or not at all. */\nconst CLOSE_ON_LINE = re`\\]|(?=$)`\n\n/**\n * A decoration marker: any of Cosense's, as the parser reads them. Only `* / - _` have a look\n * of their own; the rest (`[! 注意]`) still make the bracket a decoration and not a link.\n */\nconst MARKERS = re`[!\"#%&'()*+,\\-./{|}<>_~=]`\n\nconst NOT_STAR = re`[!\"#%&'()+,\\-./{|}<>_~=]`\n\n/**\n * A line that opens with a component tag (`.csnx`), as the language server tells one:\n * `<` or `</`, a capitalised name, then a space or the end of the tag.\n */\nconst COMPONENT_LINE = re`\\s*</?[A-Z][A-Za-z0-9_.]*(?:[^\\S\\n]|/?>)`\n\n// --- Rules, typed -----------------------------------------------------------------------\n\ntype RepositoryKey =\n | \"head\"\n | \"frontmatter\"\n | \"code-block\"\n | \"table-block\"\n | \"component\"\n | \"component-tag\"\n | \"expression\"\n | \"quote\"\n | \"inline\"\n | \"inline-in-emphasis\"\n | \"nested-bracket\"\n | \"bare-bracket\"\n\n/** `0` is the whole match; this grammar never needs more than three groups. */\ntype CaptureGroup = \"0\" | \"1\" | \"2\" | \"3\"\n\ninterface Capture {\n readonly scopes: ReadonlyArray<Scope>\n readonly patterns: ReadonlyArray<Pattern>\n}\n\ntype Captures = Readonly<Partial<Record<CaptureGroup, Capture>>>\n\ninterface Include {\n readonly _tag: \"Include\"\n readonly key: RepositoryKey\n}\n\n/** A single-line match. */\ninterface Single {\n readonly _tag: \"Single\"\n readonly scopes: ReadonlyArray<Scope>\n readonly regex: Regex\n readonly captures: Captures\n}\n\n/** From `begin` to `end`, with `patterns` tried in between. */\ninterface Region {\n readonly _tag: \"Region\"\n readonly scopes: ReadonlyArray<Scope>\n readonly begin: Regex\n readonly end: Regex\n readonly beginCaptures: Captures\n readonly endCaptures: Captures\n readonly patterns: ReadonlyArray<Pattern>\n /** Try `patterns` before `end` when both match at the same place. */\n readonly endPatternLast: boolean\n}\n\n/** Several patterns tried in order, with no scope of their own. */\ninterface Group {\n readonly _tag: \"Group\"\n readonly patterns: ReadonlyArray<Pattern>\n}\n\ntype Pattern = Include | Single | Region | Group\n\nconst include = (key: RepositoryKey): Pattern => ({ _tag: \"Include\", key })\n\nconst single = (\n regex: Regex,\n options: { readonly scopes?: ReadonlyArray<Scope>; readonly captures?: Captures } = {},\n): Pattern => ({\n _tag: \"Single\",\n regex,\n scopes: options.scopes ?? [],\n captures: options.captures ?? {},\n})\n\nconst region = (options: {\n readonly begin: Regex\n readonly end: Regex\n readonly scopes?: ReadonlyArray<Scope>\n readonly beginCaptures?: Captures\n readonly endCaptures?: Captures\n readonly patterns?: ReadonlyArray<Pattern>\n readonly endPatternLast?: boolean\n}): Pattern => ({\n _tag: \"Region\",\n begin: options.begin,\n end: options.end,\n scopes: options.scopes ?? [],\n beginCaptures: options.beginCaptures ?? {},\n endCaptures: options.endCaptures ?? {},\n patterns: options.patterns ?? [],\n endPatternLast: options.endPatternLast ?? false,\n})\n\nconst group = (patterns: ReadonlyArray<Pattern>): Pattern => ({ _tag: \"Group\", patterns })\n\nconst scoped = (...scopes: ReadonlyArray<Scope>): Capture => ({ scopes, patterns: [] })\n\nconst readAs = (...patterns: ReadonlyArray<Pattern>): Capture => ({ scopes: [], patterns })\n\nconst onlyIf = <A>(condition: boolean, value: A): Option.Option<A> =>\n condition ? Option.some(value) : Option.none()\n\n// --- Inline notation --------------------------------------------------------------------\n\ntype Weight = 0 | 1 | 2 | 3\n\n/** One combination of emphasis markers: how many `*`, and which of `/`, `-`, `_`. */\ninterface Emphasis {\n readonly stars: Weight\n readonly italic: boolean\n readonly strike: boolean\n readonly underline: boolean\n}\n\nconst WEIGHTS: ReadonlyArray<Weight> = [0, 1, 2, 3]\n\nconst SWITCHES = [false, true] as const\n\n/**\n * Every combination of markers. The one with none of `* / - _` is a run of the others alone\n * (`[! x]`), which colours nothing but still keeps the bracket from reading as a link.\n */\nconst MARKER_SETS: ReadonlyArray<Emphasis> = pipe(\n WEIGHTS,\n Arr.flatMap((stars) => Arr.map(SWITCHES, (italic) => ({ stars, italic }))),\n Arr.flatMap((set) => Arr.map(SWITCHES, (strike) => ({ ...set, strike }))),\n Arr.flatMap((set) => Arr.map(SWITCHES, (underline) => ({ ...set, underline }))),\n)\n\n/** `[*** x]` and louder are one size: Cosense caps the size, and so does the parser. */\nconst WEIGHT_SCOPE: { readonly [W in Weight]: Option.Option<Scope> } = {\n 0: Option.none(),\n 1: Option.some(SCOPES.bold),\n 2: Option.some(SCOPES.bold2),\n 3: Option.some(SCOPES.bold3),\n}\n\n/** All the scopes a run carries, since Cosense applies every marker: `[-* x]` is both. */\nconst emphasisScopes = (emphasis: Emphasis): ReadonlyArray<Scope> =>\n Arr.getSomes([\n onlyIf(emphasis.underline, SCOPES.underline),\n onlyIf(emphasis.strike, SCOPES.strike),\n onlyIf(emphasis.italic, SCOPES.italic),\n WEIGHT_SCOPE[emphasis.stars],\n ])\n\n/** A lookahead over the marker run (`[-** x]` -> `-**`) that holds for exactly this many `*`. */\nconst starCondition = (stars: Weight): Regex =>\n Match.value(stars).pipe(\n Match.when(0, () => re`(?!${MARKERS}*?\\*)`),\n Match.when(3, () => re`(?=(?:${NOT_STAR}*\\*){3})`),\n Match.orElse((count) => re`(?=(?:${NOT_STAR}*\\*){${count}}${NOT_STAR}*\\s)`),\n )\n\nconst markerCondition = (marker: Regex, wanted: boolean): Regex =>\n wanted ? re`(?=${MARKERS}*?${marker})` : re`(?!${MARKERS}*?${marker})`\n\n/** Lookaheads over the marker run that hold only for this combination. */\nconst markerConditions = (emphasis: Emphasis): Regex =>\n Regex(\n [\n starCondition(emphasis.stars),\n markerCondition(re`/`, emphasis.italic),\n markerCondition(re`\\-`, emphasis.strike),\n markerCondition(re`_`, emphasis.underline),\n ].join(\"\"),\n )\n\n/**\n * `[<markers> body]`, one rule per combination. The body is read again for links and icons\n * but not for emphasis, which does not nest in Cosense (`[* [* x]]` is bold around a link).\n */\nconst emphasisRules: ReadonlyArray<Pattern> = Arr.map(MARKER_SETS, (emphasis) =>\n region({\n scopes: emphasisScopes(emphasis),\n begin: re`\\[${markerConditions(emphasis)}(?=${MARKERS}+\\s.*\\])${MARKERS}+\\s+`,\n end: CLOSE_ON_LINE,\n patterns: [include(\"inline-in-emphasis\"), include(\"nested-bracket\")],\n }),\n)\n\n/** Anything up to, but not over, a `]]`. */\nconst UNTIL_DOUBLE_CLOSE = re`(?:(?!\\]\\]).)`\n\n/** `[[x]]`: an image when x is one, bold otherwise. Closes on the first `]]`, depth or not. */\nconst strongRules: ReadonlyArray<Pattern> = [\n single(\n re`\\[\\[(?:${IMAGE_URL}|${UNTIL_DOUBLE_CLOSE}*?${IMAGE_EXT}(?:[?#]${UNTIL_DOUBLE_CLOSE}*)?)\\]\\]`,\n { scopes: [SCOPES.image] },\n ),\n single(re`\\[\\[(${UNTIL_DOUBLE_CLOSE}+)\\]\\]`, {\n scopes: [SCOPES.bold],\n captures: { 1: readAs(include(\"inline-in-emphasis\")) },\n }),\n]\n\n/** `[$ x^2]`. Its body is TeX, not notation, and may hold brackets of its own. */\nconst formulaRule: Pattern = region({\n scopes: [SCOPES.formula],\n begin: re`\\[(?=\\$)${CLOSES}`,\n end: CLOSE_ON_LINE,\n patterns: [include(\"bare-bracket\")],\n})\n\n/**\n * Brackets whose body holds no brackets, tried in the parser's order: an icon before a\n * URL before an image path before a project link, and anything left is a page link.\n */\nconst simpleTargetRules = (allowImagePath: boolean): ReadonlyArray<Pattern> =>\n Arr.getSomes([\n Option.some(single(re`\\[[^\\[\\]]+\\.icon(?:\\*\\d+)?\\]`, { scopes: [SCOPES.icon] })),\n // Only URLs, and one of them an image: the image, linking to another URL if there is one.\n Option.some(\n single(re`\\[\\s*(?:${URL}\\s+)*(?:${IMAGE_URL})(?=[\\s\\]])(?:\\s+${URL})*\\s*\\]`, {\n scopes: [SCOPES.image],\n }),\n ),\n // Any other URL makes a link, labelled or not.\n Option.some(single(re`\\[[^\\[\\]]*${URL}[^\\[\\]]*\\]`, { scopes: [SCOPES.externalLink] })),\n // `[a.png]`, but not inside emphasis: there Cosense links to a page of that name.\n onlyIf(allowImagePath, single(re`\\[[^\\[\\]]*${IMAGE_EXT}\\]`, { scopes: [SCOPES.image] })),\n Option.some(single(re`\\[/[^\\[\\]]*\\]`, { scopes: [SCOPES.projectLink] })),\n Option.some(single(re`\\[(?=[^\\[\\]]*[^\\s\\[\\]])[^\\[\\]]+\\]`, { scopes: [SCOPES.link] })),\n ])\n\n/** What follows the bracketed notation in both contexts, in the parser's order. */\nconst unbracketedRules: ReadonlyArray<Pattern> = [\n single(Regex(\"`[^`]*`\"), { scopes: [SCOPES.code] }),\n // `#tag`, only at the start or after a space: a `#` inside a word is just a character.\n single(re`(?:^|(?<=[ \\t\\u3000]))#[^\\s\\[\\]#]+`, { scopes: [SCOPES.hashtag] }),\n // A URL outside brackets is always a link, even to an image.\n single(re`(?i:https?)://[^\\s\\]]+`, { scopes: [SCOPES.externalLink] }),\n]\n\n// --- Lines and blocks -------------------------------------------------------------------\n\n/**\n * A block is its header and every line indented deeper. Deeper is approximated as\n * \"the header's indentation, then more\", which is exact when a page indents one way.\n */\nconst block = (keyword: \"code\" | \"table\", scope: Scope, patterns: ReadonlyArray<Pattern>) =>\n region({\n scopes: [scope],\n begin: re`^(${INDENT})(${Regex(keyword)}:)(.+)$`,\n beginCaptures: {\n 2: scoped(\"keyword.other.block.cosense\"),\n 3: scoped(\"entity.name.section.block.cosense\"),\n },\n end: re`^(?!\\1[ \\t\\u3000])`,\n patterns,\n })\n\n/**\n * The first line is the title, unless the file opens with YAML: then it is the first line\n * after the fence. Nothing on the title line is notation. In `.csnx` a first line that is\n * a component tag is that tag, and the page has no title line.\n */\nconst head = (dialect: DialectInfo): Pattern => {\n const notComponent = dialect.components ? re`(?!${COMPONENT_LINE})` : re``\n return group([\n region({\n begin: re`\\A(?=---[ \\t]*$)`,\n patterns: [include(\"frontmatter\")],\n // Ends on the line after the fence either way; only a title line is captured.\n end: dialect.components ? re`^(?:(?=${COMPONENT_LINE})|(.*)$)` : re`^(.*)$`,\n endCaptures: { 1: scoped(SCOPES.title) },\n // At the very start the fence and the title line both match: the fence wins.\n endPatternLast: true,\n }),\n single(re`\\A${notComponent}.*$`, { scopes: [SCOPES.title] }),\n ])\n}\n\n/** Every other entry the grammar can `include`. The mapped type makes a missing one an error. */\nconst REPOSITORY: { readonly [K in Exclude<RepositoryKey, \"head\">]: Pattern } = {\n frontmatter: region({\n scopes: [SCOPES.frontmatter],\n begin: re`\\A---[ \\t]*$`,\n end: re`^---[ \\t]*$`,\n }),\n \"code-block\": block(\"code\", SCOPES.codeBlock, []),\n \"table-block\": block(\"table\", SCOPES.table, [\n single(re`\\t`, { scopes: [\"punctuation.separator.table-cell.cosense\"] }),\n ]),\n // A component tag owns its line: nothing on it is Cosense notation, and the text after\n // the tag is plain.\n component: region({\n scopes: [\"meta.tag.component.cosense\"],\n begin: re`^(?=${COMPONENT_LINE})`,\n end: re`$`,\n patterns: [include(\"component-tag\")],\n }),\n // The tag itself, read as JSX.\n \"component-tag\": region({\n begin: re`^(\\s*)(</?)([A-Z][A-Za-z0-9_.]*)`,\n beginCaptures: {\n 2: scoped(\"punctuation.definition.tag.begin.cosense\"),\n 3: scoped(SCOPES.component),\n },\n end: re`(/?>)|(?=$)`,\n endCaptures: { 1: scoped(\"punctuation.definition.tag.end.cosense\") },\n patterns: [\n single(re`[A-Za-z_:][A-Za-z0-9_:.\\-]*`, { scopes: [SCOPES.attribute] }),\n single(re`=`, { scopes: [\"punctuation.separator.key-value.cosense\"] }),\n single(re`\"[^\"]*(?:\"|$)|'[^']*(?:'|$)`, { scopes: [SCOPES.attributeValue] }),\n include(\"expression\"),\n ],\n }),\n // `{...}`: a JavaScript expression. Braces nest; a few literals are told apart.\n expression: region({\n scopes: [SCOPES.expression],\n begin: re`\\{`,\n end: re`\\}|(?=$)`,\n beginCaptures: { 0: scoped(\"punctuation.section.embedded.begin.cosense\") },\n endCaptures: { 0: scoped(\"punctuation.section.embedded.end.cosense\") },\n patterns: [\n include(\"expression\"),\n single(re`\"[^\"]*\"|'[^']*'`, { scopes: [\"string.quoted.cosense\"] }),\n single(re`\\b\\d+(?:\\.\\d+)?\\b`, { scopes: [\"constant.numeric.cosense\"] }),\n single(re`\\b(?:true|false|null|undefined)\\b`, { scopes: [\"constant.language.cosense\"] }),\n ],\n }),\n quote: region({\n scopes: [\"markup.quote.cosense\"],\n begin: re`^${INDENT}(>[> ]*)`,\n beginCaptures: { 1: scoped(SCOPES.quote) },\n end: re`$`,\n patterns: [include(\"inline\")],\n }),\n inline: group([\n ...strongRules,\n formulaRule,\n ...emphasisRules,\n ...simpleTargetRules(true),\n ...unbracketedRules,\n ]),\n \"inline-in-emphasis\": group([\n ...strongRules,\n formulaRule,\n ...simpleTargetRules(false),\n ...unbracketedRules,\n ]),\n // A bracket that is no notation, but whose `]` must not close the one around it:\n // in `[* a [] b]` the emphasis runs to the last `]`, as the parser counts depth.\n \"nested-bracket\": region({\n begin: re`\\[`,\n end: CLOSE_ON_LINE,\n patterns: [include(\"inline-in-emphasis\"), include(\"nested-bracket\")],\n }),\n \"bare-bracket\": region({\n begin: re`\\[`,\n end: CLOSE_ON_LINE,\n patterns: [include(\"bare-bracket\")],\n }),\n}\n\n// --- Encoding ---------------------------------------------------------------------------\n\n/** A field only when there is something to put in it: TextMate reads absent and empty alike. */\nconst field = <K extends keyof Rule>(key: K, value: Option.Option<Rule[K]>): Partial<Rule> =>\n Option.match(value, { onNone: () => ({}), onSome: (v) => ({ [key]: v }) })\n\nconst nonEmpty = <A>(items: ReadonlyArray<A>): Option.Option<ReadonlyArray<A>> =>\n Option.liftPredicate(items, (list) => list.length > 0)\n\n/** TextMate gives a rule several scopes by separating them with spaces. */\nconst nameField = (scopes: ReadonlyArray<Scope>): Partial<Rule> =>\n field(\n \"name\",\n Option.map(nonEmpty(scopes), (list) => list.join(\" \")),\n )\n\nconst patternsField = (patterns: ReadonlyArray<Pattern>): Partial<Rule> =>\n field(\"patterns\", Option.map(nonEmpty(patterns), Arr.map(encode)))\n\nconst encodeCaptures = (captures: Captures): Option.Option<Record<string, Rule>> =>\n pipe(\n Object.entries(captures),\n Arr.map(\n ([group, capture]) =>\n [group, { ...nameField(capture.scopes), ...patternsField(capture.patterns) }] as const,\n ),\n nonEmpty,\n Option.map(Rec.fromEntries),\n )\n\nconst encode = (pattern: Pattern): Rule =>\n Match.value(pattern).pipe(\n Match.tag(\"Include\", ({ key }) => ({ include: `#${key}` })),\n Match.tag(\"Group\", ({ patterns }) => patternsField(patterns)),\n Match.tag(\"Single\", (rule) => ({\n ...nameField(rule.scopes),\n match: rule.regex,\n ...field(\"captures\", encodeCaptures(rule.captures)),\n })),\n Match.tag(\"Region\", (rule) => ({\n ...nameField(rule.scopes),\n begin: rule.begin,\n end: rule.end,\n ...field(\"beginCaptures\", encodeCaptures(rule.beginCaptures)),\n ...field(\"endCaptures\", encodeCaptures(rule.endCaptures)),\n ...patternsField(rule.patterns),\n ...field(\"applyEndPatternLast\", onlyIf(rule.endPatternLast, true)),\n })),\n Match.exhaustive,\n )\n\n// --- Dialects ---------------------------------------------------------------------------\n\n/** `.csn`, and `.csnx`, which also reads a line that is one component tag. */\nexport type Dialect = \"cosense\" | \"cosense-x\"\n\ninterface DialectInfo {\n readonly displayName: string\n readonly extension: string\n readonly components: boolean\n}\n\nconst DIALECTS: { readonly [D in Dialect]: DialectInfo } = {\n cosense: { displayName: \"Cosense\", extension: \"csn\", components: false },\n \"cosense-x\": { displayName: \"Cosense X\", extension: \"csnx\", components: true },\n}\n\n/** What a line can be, in the order the parser decides it. */\nconst linePatterns = (dialect: DialectInfo): ReadonlyArray<Pattern> =>\n Arr.getSomes([\n Option.some(include(\"head\")),\n Option.some(include(\"code-block\")),\n Option.some(include(\"table-block\")),\n onlyIf(dialect.components, include(\"component\")),\n Option.some(include(\"quote\")),\n Option.some(include(\"inline\")),\n ])\n\nexport const buildGrammar = (dialect: Dialect): Grammar => {\n const info = DIALECTS[dialect]\n return {\n name: dialect,\n displayName: info.displayName,\n scopeName: `text.${dialect}`,\n aliases: [info.extension],\n fileTypes: [info.extension],\n patterns: Arr.map(linePatterns(info), encode),\n repository: Rec.map({ head: head(info), ...REPOSITORY }, encode),\n }\n}\n","/**\n * TextMate grammars for Cosense notation: `.csn` and, with component lines, `.csnx`.\n *\n * Each export is a Shiki `LanguageRegistration` as it stands, and the same objects are\n * published as `.tmLanguage.json` for editors that read TextMate grammars.\n */\nimport { buildGrammar, type Grammar } from \"./grammar\"\n\nexport type { Dialect, Grammar, Rule } from \"./grammar\"\nexport { type Notation, SCOPES } from \"./scopes\"\n\nexport const cosense: Grammar = buildGrammar(\"cosense\")\n\nexport const cosenseX: Grammar = buildGrammar(\"cosense-x\")\n"],"mappings":";;;;;;;;;;AAcA,MAAa,SAAS;CACpB,OAAO;CACP,MAAM;CACN,aAAa;CACb,cAAc;CACd,SAAS;CACT,MAAM;CACN,WAAW;CACX,SAAS;CACT,MAAM;CAGN,OAAO;CACP,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,WAAW;CACX,OAAO;CACP,OAAO;CAEP,OAAO;CACP,OAAO;CAGP,WAAW;CACX,WAAW;CACX,gBAAgB;CAChB,YAAY;CACZ,aAAa;AACf;;;;;;;;;;;;;;;;ACKA,MAAM,QAAQ,MAAM,QAAe;;AAGnC,MAAM,MAAM,SAA+B,GAAG,UAC5C,MAAM,OAAO,IAAI,SAAS,GAAG,KAAK,CAAC;AAErC,MAAM,SAAS,iBACb,MAAM,aAAa,KAAK,gBAAgB,MAAM,YAAY,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC;;AAGzE,MAAM,SAAS,EAAE;AAEjB,MAAM,YAAY,EAAE;;;;;;AAOpB,MAAM,YAAY,MAAM;CACtB,EAAE;CACF,EAAE,6BAA6B,UAAU;CACzC,EAAE,uCAAuC;AAC3C,CAAC;AAED,MAAM,MAAM,EAAE;;AAGd,MAAM,SAAS,EAAE;;AAGjB,MAAM,gBAAgB,EAAE;;;;;AAMxB,MAAM,UAAU,EAAE;AAElB,MAAM,WAAW,EAAE;;;;;AAMnB,MAAM,iBAAiB,EAAE;AA8DzB,MAAM,WAAW,SAAiC;CAAE,MAAM;CAAW;AAAI;AA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X,OAAO,KAAK,QAAQ,MAAM,CAAC;CAC3B,OAAO,KAAK,QAAQ,YAAY,CAAC;CACjC,OAAO,KAAK,QAAQ,aAAa,CAAC;CAClC,OAAO,QAAQ,YAAY,QAAQ,WAAW,CAAC;CAC/C,OAAO,KAAK,QAAQ,OAAO,CAAC;CAC5B,OAAO,KAAK,QAAQ,QAAQ,CAAC;AAC/B,CAAC;AAEH,MAAa,gBAAgB,YAA8B;CACzD,MAAM,OAAO,SAAS;CACtB,OAAO;EACL,MAAM;EACN,aAAa,KAAK;EAClB,WAAW,QAAQ;EACnB,SAAS,CAAC,KAAK,SAAS;EACxB,WAAW,CAAC,KAAK,SAAS;EAC1B,UAAUA,MAAI,IAAI,aAAa,IAAI,GAAG,MAAM;EAC5C,YAAYC,OAAI,IAAI;GAAE,MAAM,KAAK,IAAI;GAAG,GAAG;EAAW,GAAG,MAAM;CACjE;AACF;;;;;;;;;AC/gBA,MAAa,UAAmB,aAAa,SAAS;AAEtD,MAAa,WAAoB,aAAa,WAAW"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["Arr","Rec"],"sources":["../src/scopes.ts","../src/grammar.ts","../src/index.ts"],"sourcesContent":["/**\n * A scope this grammar gives. Every one ends in `.cosense`, which is how a theme or a\n * reader tells them from the scopes of a language embedded next to Cosense.\n */\nexport type Scope = `${string}.cosense`\n\n/**\n * The TextMate scope each Cosense notation is drawn as.\n *\n * Keys are the token names @cosense-toolbox/lsp reasons in, so the two\n * highlighters describe the same things; the parity test holds them to it. Each scope\n * starts with a name themes already colour (`markup.bold`, `string.other.link`, ...), so\n * any Shiki or VS Code theme draws Cosense without knowing about it.\n */\nexport const SCOPES = {\n title: \"markup.heading.cosense\",\n link: \"string.other.link.internal.cosense\",\n projectLink: \"string.other.link.project.cosense\",\n externalLink: \"markup.underline.link.external.cosense\",\n hashtag: \"entity.name.tag.hashtag.cosense\",\n code: \"markup.inline.raw.cosense\",\n codeBlock: \"markup.raw.block.cosense\",\n formula: \"constant.other.formula.cosense\",\n icon: \"string.other.link.icon.cosense\",\n // Only the `>` marker, as the language server marks it. The whole line also carries\n // `markup.quote.cosense` so themes can tint it.\n quote: \"punctuation.definition.quote.begin.cosense\",\n bold: \"markup.bold.cosense\",\n italic: \"markup.italic.cosense\",\n strike: \"markup.strikethrough.cosense\",\n underline: \"markup.underline.cosense\",\n image: \"markup.underline.link.image.cosense\",\n table: \"markup.other.table.cosense\",\n // `[** x]` and louder: still bold to a theme, but a level apart for anyone who wants it.\n bold2: \"markup.bold.level2.cosense\",\n bold3: \"markup.bold.level3.cosense\",\n // `.csnx` only: the tag that opens a component line, read as JSX. The whole line also\n // carries `meta.tag.component.cosense`.\n component: \"support.class.component.cosense\",\n attribute: \"entity.other.attribute-name.cosense\",\n attributeValue: \"string.quoted.attribute-value.cosense\",\n expression: \"meta.embedded.expression.cosense\",\n frontmatter: \"comment.block.frontmatter.cosense\",\n} as const satisfies Record<string, Scope>\n\nexport type Notation = keyof typeof SCOPES\n","/**\n * The Cosense grammar, built from code rather than written as JSON: emphasis alone takes\n * one rule per combination of markers, and those are generated.\n *\n * The rules follow @cosense-toolbox/parser, and where they cannot (TextMate reads line by\n * line with regexes, the parser reads the whole page) they approximate it. The parity test\n * measures how close that is against the language server.\n *\n * Rules are first built as a tagged union (`Pattern`) and only then encoded as TextMate\n * JSON. The union is what keeps the grammar honest: a rule is a match or a region and never\n * half of each, every `include` names a repository entry that exists, and every scope ends\n * in `.cosense`. A typo in any of those fails to compile instead of silently colouring nothing.\n */\nimport { Array as Arr, Brand, Match, Option, pipe, Record as Rec } from \"effect\"\n\nimport { type Scope, SCOPES } from \"./scopes\"\n\n// --- The output: what Shiki and VS Code read ------------------------------------------\n\n/** A TextMate rule as JSON. Assignable to Shiki's and VS Code's own types. */\nexport interface Rule {\n name?: string\n match?: string\n begin?: string\n end?: string\n captures?: Record<string, Rule>\n beginCaptures?: Record<string, Rule>\n endCaptures?: Record<string, Rule>\n patterns?: Rule[]\n include?: string\n applyEndPatternLast?: boolean\n}\n\n/** A grammar as Shiki takes it (`LanguageRegistration`), which is also a `.tmLanguage.json`. */\nexport interface Grammar {\n name: Dialect\n displayName: string\n scopeName: `text.${Dialect}`\n aliases: string[]\n fileTypes: string[]\n patterns: Rule[]\n repository: Record<string, Rule>\n}\n\n// --- Regexes ----------------------------------------------------------------------------\n\n/** A regex in Oniguruma syntax. Branded so a scope or a label cannot be passed as one. */\ntype Regex = string & Brand.Brand<\"Regex\">\nconst Regex = Brand.nominal<Regex>()\n\n/** A regex written raw: backslashes are the regex's, not the string literal's. */\nconst re = (strings: TemplateStringsArray, ...parts: ReadonlyArray<Regex | number>): Regex =>\n Regex(String.raw(strings, ...parts))\n\nconst oneOf = (alternatives: Arr.NonEmptyReadonlyArray<Regex>): Regex =>\n Regex(alternatives.map((alternative) => `(?:${alternative})`).join(\"|\"))\n\n/** Indentation, as the parser counts it: full-width spaces (U+3000) indent too. */\nconst INDENT = re`[ \\t\\u3000]*`\n\nconst IMAGE_EXT = re`\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)`\n\n/**\n * A URL that is drawn as an image, inside a bracket (so without `[`, `]` or spaces):\n * a Gyazo page, a path ending in an image extension before any query, or a fragment\n * ending in one (`#.svg`, Cosense's way of saying \"this is an image\").\n */\nconst IMAGE_URL = oneOf([\n re`(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*`,\n re`(?i:https?)://[^\\s\\[\\]?#]*${IMAGE_EXT}(?:[?#][^\\s\\[\\]]*)?`,\n re`(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*${IMAGE_EXT}`,\n])\n\nconst URL = re`(?i:https?)://[^\\s\\[\\]]+`\n\n/** What a bracket must end with somewhere, or it is plain text and not worth a rule. */\nconst CLOSES = re`(?=.*\\])`\n\n/**\n * No inline code starts inside the bracket that opens here. Cosense reads code before\n * brackets, so a bracket with a code span starting inside it is no notation (`[a `b` c]`).\n * A span starts at a backtick with another one anywhere after it. One level of brackets is\n * stepped over, as emphasis holds them (`[* a [b] `c`]`). The backtick is written `\\x60`,\n * which both regex engines read the same.\n */\nconst NO_CODE_INSIDE = re`(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)`\n\n/** The same for `[[x]]`, which closes on the first `]]`. */\nconst NO_CODE_INSIDE_DOUBLE = re`(?!(?:(?!\\]\\])[^\\x60])*\\x60.*\\x60)`\n\n/** A bracket closes on its own line or not at all. */\nconst CLOSE_ON_LINE = re`\\]|(?=$)`\n\n/**\n * A decoration marker: any of Cosense's, as the parser reads them. Only `* / - _` have a look\n * of their own; the rest (`[! 注意]`) still make the bracket a decoration and not a link.\n */\nconst MARKERS = re`[!\"#%&'()*+,\\-./{|}<>_~=]`\n\nconst NOT_STAR = re`[!\"#%&'()+,\\-./{|}<>_~=]`\n\n/**\n * A line that opens with a component tag (`.csnx`), as the language server tells one:\n * `<` or `</`, a capitalised name, then a space or the end of the tag.\n */\nconst COMPONENT_LINE = re`\\s*</?[A-Z][A-Za-z0-9_.]*(?:[^\\S\\n]|/?>)`\n\n// --- Rules, typed -----------------------------------------------------------------------\n\ntype RepositoryKey =\n | \"head\"\n | \"frontmatter\"\n | \"code-block\"\n | \"table-block\"\n | \"component\"\n | \"component-tag\"\n | \"expression\"\n | \"quote\"\n | \"command\"\n | \"inline\"\n | \"inline-in-emphasis\"\n | \"nested-bracket\"\n | \"bare-bracket\"\n\n/** `0` is the whole match; this grammar never needs more than three groups. */\ntype CaptureGroup = \"0\" | \"1\" | \"2\" | \"3\"\n\ninterface Capture {\n readonly scopes: ReadonlyArray<Scope>\n readonly patterns: ReadonlyArray<Pattern>\n}\n\ntype Captures = Readonly<Partial<Record<CaptureGroup, Capture>>>\n\ninterface Include {\n readonly _tag: \"Include\"\n readonly key: RepositoryKey\n}\n\n/** A single-line match. */\ninterface Single {\n readonly _tag: \"Single\"\n readonly scopes: ReadonlyArray<Scope>\n readonly regex: Regex\n readonly captures: Captures\n}\n\n/** From `begin` to `end`, with `patterns` tried in between. */\ninterface Region {\n readonly _tag: \"Region\"\n readonly scopes: ReadonlyArray<Scope>\n readonly begin: Regex\n readonly end: Regex\n readonly beginCaptures: Captures\n readonly endCaptures: Captures\n readonly patterns: ReadonlyArray<Pattern>\n /** Try `patterns` before `end` when both match at the same place. */\n readonly endPatternLast: boolean\n}\n\n/** Several patterns tried in order, with no scope of their own. */\ninterface Group {\n readonly _tag: \"Group\"\n readonly patterns: ReadonlyArray<Pattern>\n}\n\ntype Pattern = Include | Single | Region | Group\n\nconst include = (key: RepositoryKey): Pattern => ({ _tag: \"Include\", key })\n\nconst single = (\n regex: Regex,\n options: { readonly scopes?: ReadonlyArray<Scope>; readonly captures?: Captures } = {},\n): Pattern => ({\n _tag: \"Single\",\n regex,\n scopes: options.scopes ?? [],\n captures: options.captures ?? {},\n})\n\nconst region = (options: {\n readonly begin: Regex\n readonly end: Regex\n readonly scopes?: ReadonlyArray<Scope>\n readonly beginCaptures?: Captures\n readonly endCaptures?: Captures\n readonly patterns?: ReadonlyArray<Pattern>\n readonly endPatternLast?: boolean\n}): Pattern => ({\n _tag: \"Region\",\n begin: options.begin,\n end: options.end,\n scopes: options.scopes ?? [],\n beginCaptures: options.beginCaptures ?? {},\n endCaptures: options.endCaptures ?? {},\n patterns: options.patterns ?? [],\n endPatternLast: options.endPatternLast ?? false,\n})\n\nconst group = (patterns: ReadonlyArray<Pattern>): Pattern => ({ _tag: \"Group\", patterns })\n\nconst scoped = (...scopes: ReadonlyArray<Scope>): Capture => ({ scopes, patterns: [] })\n\nconst readAs = (...patterns: ReadonlyArray<Pattern>): Capture => ({ scopes: [], patterns })\n\nconst onlyIf = <A>(condition: boolean, value: A): Option.Option<A> =>\n condition ? Option.some(value) : Option.none()\n\n// --- Inline notation --------------------------------------------------------------------\n\ntype Weight = 0 | 1 | 2 | 3\n\n/** One combination of emphasis markers: how many `*`, and which of `/`, `-`, `_`. */\ninterface Emphasis {\n readonly stars: Weight\n readonly italic: boolean\n readonly strike: boolean\n readonly underline: boolean\n}\n\nconst WEIGHTS: ReadonlyArray<Weight> = [0, 1, 2, 3]\n\nconst SWITCHES = [false, true] as const\n\n/**\n * Every combination of markers. The one with none of `* / - _` is a run of the others alone\n * (`[! x]`), which colours nothing but still keeps the bracket from reading as a link.\n */\nconst MARKER_SETS: ReadonlyArray<Emphasis> = pipe(\n WEIGHTS,\n Arr.flatMap((stars) => Arr.map(SWITCHES, (italic) => ({ stars, italic }))),\n Arr.flatMap((set) => Arr.map(SWITCHES, (strike) => ({ ...set, strike }))),\n Arr.flatMap((set) => Arr.map(SWITCHES, (underline) => ({ ...set, underline }))),\n)\n\n/** `[*** x]` and louder are one size: Cosense caps the size, and so does the parser. */\nconst WEIGHT_SCOPE: { readonly [W in Weight]: Option.Option<Scope> } = {\n 0: Option.none(),\n 1: Option.some(SCOPES.bold),\n 2: Option.some(SCOPES.bold2),\n 3: Option.some(SCOPES.bold3),\n}\n\n/** All the scopes a run carries, since Cosense applies every marker: `[-* x]` is both. */\nconst emphasisScopes = (emphasis: Emphasis): ReadonlyArray<Scope> =>\n Arr.getSomes([\n onlyIf(emphasis.underline, SCOPES.underline),\n onlyIf(emphasis.strike, SCOPES.strike),\n onlyIf(emphasis.italic, SCOPES.italic),\n WEIGHT_SCOPE[emphasis.stars],\n ])\n\n/** A lookahead over the marker run (`[-** x]` -> `-**`) that holds for exactly this many `*`. */\nconst starCondition = (stars: Weight): Regex =>\n Match.value(stars).pipe(\n Match.when(0, () => re`(?!${MARKERS}*?\\*)`),\n Match.when(3, () => re`(?=(?:${NOT_STAR}*\\*){3})`),\n Match.orElse((count) => re`(?=(?:${NOT_STAR}*\\*){${count}}${NOT_STAR}*\\s)`),\n )\n\nconst markerCondition = (marker: Regex, wanted: boolean): Regex =>\n wanted ? re`(?=${MARKERS}*?${marker})` : re`(?!${MARKERS}*?${marker})`\n\n/** Lookaheads over the marker run that hold only for this combination. */\nconst markerConditions = (emphasis: Emphasis): Regex =>\n Regex(\n [\n starCondition(emphasis.stars),\n markerCondition(re`/`, emphasis.italic),\n markerCondition(re`\\-`, emphasis.strike),\n markerCondition(re`_`, emphasis.underline),\n ].join(\"\"),\n )\n\n/**\n * `[<markers> body]`, one rule per combination. The body is read again for links and icons\n * but not for emphasis, which does not nest in Cosense (`[* [* x]]` is bold around a link).\n */\nconst emphasisRules: ReadonlyArray<Pattern> = Arr.map(MARKER_SETS, (emphasis) =>\n region({\n scopes: emphasisScopes(emphasis),\n begin: re`\\[${NO_CODE_INSIDE}${markerConditions(emphasis)}(?=${MARKERS}+\\s.*\\])${MARKERS}+\\s+`,\n end: CLOSE_ON_LINE,\n patterns: [include(\"inline-in-emphasis\"), include(\"nested-bracket\")],\n }),\n)\n\n/** Anything up to, but not over, a `]]`. */\nconst UNTIL_DOUBLE_CLOSE = re`(?:(?!\\]\\]).)`\n\n/** `[[x]]`: an image when x is one, bold otherwise. Closes on the first `]]`, depth or not. */\nconst strongRules: ReadonlyArray<Pattern> = [\n single(\n re`\\[\\[${NO_CODE_INSIDE_DOUBLE}(?:${IMAGE_URL}|${UNTIL_DOUBLE_CLOSE}*?${IMAGE_EXT}(?:[?#]${UNTIL_DOUBLE_CLOSE}*)?)\\]\\]`,\n { scopes: [SCOPES.image] },\n ),\n single(re`\\[\\[${NO_CODE_INSIDE_DOUBLE}(${UNTIL_DOUBLE_CLOSE}+)\\]\\]`, {\n scopes: [SCOPES.bold],\n captures: { 1: readAs(include(\"inline-in-emphasis\")) },\n }),\n]\n\n/**\n * `[$ x^2]`. Its body is TeX, not notation, and may hold brackets of its own. Like any\n * bracket, it is no formula when inline code starts inside it (`[$ a``]`).\n */\nconst formulaRule: Pattern = region({\n scopes: [SCOPES.formula],\n begin: re`\\[${NO_CODE_INSIDE}(?=\\$)${CLOSES}`,\n end: CLOSE_ON_LINE,\n patterns: [include(\"bare-bracket\")],\n})\n\n/**\n * Brackets whose body holds no brackets, tried in the parser's order: an icon before a\n * URL before an image path before a project link, and anything left is a page link.\n */\nconst simpleTargetRules = (allowImagePath: boolean): ReadonlyArray<Pattern> =>\n Arr.getSomes([\n Option.some(\n single(re`\\[${NO_CODE_INSIDE}[^\\[\\]]+\\.icon(?:\\*\\d+)?\\]`, { scopes: [SCOPES.icon] }),\n ),\n // Only URLs, and one of them an image: the image, linking to another URL if there is one.\n Option.some(\n single(\n re`\\[${NO_CODE_INSIDE}\\s*(?:${URL}\\s+)*(?:${IMAGE_URL})(?=[\\s\\]])(?:\\s+${URL})*\\s*\\]`,\n {\n scopes: [SCOPES.image],\n },\n ),\n ),\n // Any other URL makes a link, labelled or not.\n Option.some(\n single(re`\\[${NO_CODE_INSIDE}[^\\[\\]]*${URL}[^\\[\\]]*\\]`, { scopes: [SCOPES.externalLink] }),\n ),\n // `[a.png]`, but not inside emphasis: there Cosense links to a page of that name.\n onlyIf(\n allowImagePath,\n single(re`\\[${NO_CODE_INSIDE}[^\\[\\]]*${IMAGE_EXT}\\]`, { scopes: [SCOPES.image] }),\n ),\n Option.some(single(re`\\[${NO_CODE_INSIDE}/[^\\[\\]]*\\]`, { scopes: [SCOPES.projectLink] })),\n Option.some(\n single(re`\\[${NO_CODE_INSIDE}(?=[^\\[\\]]*[^\\s\\[\\]])[^\\[\\]]+\\]`, { scopes: [SCOPES.link] }),\n ),\n ])\n\n/** What follows the bracketed notation in both contexts, in the parser's order. */\nconst unbracketedRules: ReadonlyArray<Pattern> = [\n single(Regex(\"`[^`]*`\"), { scopes: [SCOPES.code] }),\n // `#tag`, only at the start or after a space: a `#` inside a word is just a character.\n single(re`(?:^|(?<=[ \\t\\u3000]))#[^\\s\\[\\]#]+`, { scopes: [SCOPES.hashtag] }),\n // A URL outside brackets is always a link, even to an image.\n single(re`(?i:https?)://[^\\s\\]]+`, { scopes: [SCOPES.externalLink] }),\n]\n\n// --- Lines and blocks -------------------------------------------------------------------\n\n/**\n * A block is its header and every line indented deeper. Deeper is approximated as\n * \"the header's indentation, then more\", which is exact when a page indents one way.\n */\nconst block = (keyword: \"code\" | \"table\", scope: Scope, patterns: ReadonlyArray<Pattern>) =>\n region({\n scopes: [scope],\n begin: re`^(${INDENT})(${Regex(keyword)}:)(.+)$`,\n beginCaptures: {\n 2: scoped(\"keyword.other.block.cosense\"),\n 3: scoped(\"entity.name.section.block.cosense\"),\n },\n end: re`^(?!\\1[ \\t\\u3000])`,\n patterns,\n })\n\n/**\n * The first line is the title, unless the file opens with YAML: then it is the first line\n * after the fence. Nothing on the title line is notation. In `.csnx` a first line that is\n * a component tag is that tag, and the page has no title line.\n */\nconst head = (dialect: DialectInfo): Pattern => {\n const notComponent = dialect.components ? re`(?!${COMPONENT_LINE})` : re``\n return group([\n region({\n begin: re`\\A(?=---[ \\t]*$)`,\n patterns: [include(\"frontmatter\")],\n // Ends on the line after the fence either way; only a title line is captured.\n end: dialect.components ? re`^(?:(?=${COMPONENT_LINE})|(.*)$)` : re`^(.*)$`,\n endCaptures: { 1: scoped(SCOPES.title) },\n // At the very start the fence and the title line both match: the fence wins.\n endPatternLast: true,\n }),\n single(re`\\A${notComponent}.*$`, { scopes: [SCOPES.title] }),\n ])\n}\n\n/** Every other entry the grammar can `include`. The mapped type makes a missing one an error. */\nconst REPOSITORY: { readonly [K in Exclude<RepositoryKey, \"head\">]: Pattern } = {\n frontmatter: region({\n scopes: [SCOPES.frontmatter],\n begin: re`\\A---[ \\t]*$`,\n end: re`^---[ \\t]*$`,\n }),\n \"code-block\": block(\"code\", SCOPES.codeBlock, []),\n \"table-block\": block(\"table\", SCOPES.table, [\n single(re`\\t`, { scopes: [\"punctuation.separator.table-cell.cosense\"] }),\n ]),\n // A component tag owns its line: nothing on it is Cosense notation, and the text after\n // the tag is plain.\n component: region({\n scopes: [\"meta.tag.component.cosense\"],\n begin: re`^(?=${COMPONENT_LINE})`,\n end: re`$`,\n patterns: [include(\"component-tag\")],\n }),\n // The tag itself, read as JSX.\n \"component-tag\": region({\n begin: re`^(\\s*)(</?)([A-Z][A-Za-z0-9_.]*)`,\n beginCaptures: {\n 2: scoped(\"punctuation.definition.tag.begin.cosense\"),\n 3: scoped(SCOPES.component),\n },\n end: re`(/?>)|(?=$)`,\n endCaptures: { 1: scoped(\"punctuation.definition.tag.end.cosense\") },\n patterns: [\n single(re`[A-Za-z_:][A-Za-z0-9_:.\\-]*`, { scopes: [SCOPES.attribute] }),\n single(re`=`, { scopes: [\"punctuation.separator.key-value.cosense\"] }),\n single(re`\"[^\"]*(?:\"|$)|'[^']*(?:'|$)`, { scopes: [SCOPES.attributeValue] }),\n include(\"expression\"),\n ],\n }),\n // `{...}`: a JavaScript expression. Braces nest; a few literals are told apart.\n expression: region({\n scopes: [SCOPES.expression],\n begin: re`\\{`,\n end: re`\\}|(?=$)`,\n beginCaptures: { 0: scoped(\"punctuation.section.embedded.begin.cosense\") },\n endCaptures: { 0: scoped(\"punctuation.section.embedded.end.cosense\") },\n patterns: [\n include(\"expression\"),\n single(re`\"[^\"]*\"|'[^']*'`, { scopes: [\"string.quoted.cosense\"] }),\n single(re`\\b\\d+(?:\\.\\d+)?\\b`, { scopes: [\"constant.numeric.cosense\"] }),\n single(re`\\b(?:true|false|null|undefined)\\b`, { scopes: [\"constant.language.cosense\"] }),\n ],\n }),\n // `$ ls` or `% ls` after the indent: a command, code as a whole. Nothing in it is notation.\n command: single(re`^${INDENT}([$%] .+)$`, { captures: { 1: scoped(SCOPES.code) } }),\n quote: region({\n scopes: [\"markup.quote.cosense\"],\n begin: re`^${INDENT}(>[> ]*)`,\n beginCaptures: { 1: scoped(SCOPES.quote) },\n end: re`$`,\n patterns: [include(\"inline\")],\n }),\n inline: group([\n ...strongRules,\n formulaRule,\n ...emphasisRules,\n ...simpleTargetRules(true),\n ...unbracketedRules,\n ]),\n \"inline-in-emphasis\": group([\n ...strongRules,\n formulaRule,\n ...simpleTargetRules(false),\n ...unbracketedRules,\n ]),\n // A bracket that is no notation, but whose `]` must not close the one around it:\n // in `[* a [] b]` the emphasis runs to the last `]`, as the parser counts depth.\n \"nested-bracket\": region({\n begin: re`\\[`,\n end: CLOSE_ON_LINE,\n patterns: [include(\"inline-in-emphasis\"), include(\"nested-bracket\")],\n }),\n \"bare-bracket\": region({\n begin: re`\\[`,\n end: CLOSE_ON_LINE,\n patterns: [include(\"bare-bracket\")],\n }),\n}\n\n// --- Encoding ---------------------------------------------------------------------------\n\n/** A field only when there is something to put in it: TextMate reads absent and empty alike. */\nconst field = <K extends keyof Rule>(key: K, value: Option.Option<Rule[K]>): Partial<Rule> =>\n Option.match(value, { onNone: () => ({}), onSome: (v) => ({ [key]: v }) })\n\nconst nonEmpty = <A>(items: ReadonlyArray<A>): Option.Option<ReadonlyArray<A>> =>\n Option.liftPredicate(items, (list) => list.length > 0)\n\n/** TextMate gives a rule several scopes by separating them with spaces. */\nconst nameField = (scopes: ReadonlyArray<Scope>): Partial<Rule> =>\n field(\n \"name\",\n Option.map(nonEmpty(scopes), (list) => list.join(\" \")),\n )\n\nconst patternsField = (patterns: ReadonlyArray<Pattern>): Partial<Rule> =>\n field(\"patterns\", Option.map(nonEmpty(patterns), Arr.map(encode)))\n\nconst encodeCaptures = (captures: Captures): Option.Option<Record<string, Rule>> =>\n pipe(\n Object.entries(captures),\n Arr.map(\n ([group, capture]) =>\n [group, { ...nameField(capture.scopes), ...patternsField(capture.patterns) }] as const,\n ),\n nonEmpty,\n Option.map(Rec.fromEntries),\n )\n\nconst encode = (pattern: Pattern): Rule =>\n Match.value(pattern).pipe(\n Match.tag(\"Include\", ({ key }) => ({ include: `#${key}` })),\n Match.tag(\"Group\", ({ patterns }) => patternsField(patterns)),\n Match.tag(\"Single\", (rule) => ({\n ...nameField(rule.scopes),\n match: rule.regex,\n ...field(\"captures\", encodeCaptures(rule.captures)),\n })),\n Match.tag(\"Region\", (rule) => ({\n ...nameField(rule.scopes),\n begin: rule.begin,\n end: rule.end,\n ...field(\"beginCaptures\", encodeCaptures(rule.beginCaptures)),\n ...field(\"endCaptures\", encodeCaptures(rule.endCaptures)),\n ...patternsField(rule.patterns),\n ...field(\"applyEndPatternLast\", onlyIf(rule.endPatternLast, true)),\n })),\n Match.exhaustive,\n )\n\n// --- Dialects ---------------------------------------------------------------------------\n\n/** `.csn`, and `.csnx`, which also reads a line that is one component tag. */\nexport type Dialect = \"cosense\" | \"cosense-x\"\n\ninterface DialectInfo {\n readonly displayName: string\n readonly extension: string\n readonly components: boolean\n}\n\nconst DIALECTS: { readonly [D in Dialect]: DialectInfo } = {\n cosense: { displayName: \"Cosense\", extension: \"csn\", components: false },\n \"cosense-x\": { displayName: \"Cosense X\", extension: \"csnx\", components: true },\n}\n\n/** What a line can be, in the order the parser decides it. */\nconst linePatterns = (dialect: DialectInfo): ReadonlyArray<Pattern> =>\n Arr.getSomes([\n Option.some(include(\"head\")),\n Option.some(include(\"code-block\")),\n Option.some(include(\"table-block\")),\n onlyIf(dialect.components, include(\"component\")),\n Option.some(include(\"command\")),\n Option.some(include(\"quote\")),\n Option.some(include(\"inline\")),\n ])\n\nexport const buildGrammar = (dialect: Dialect): Grammar => {\n const info = DIALECTS[dialect]\n return {\n name: dialect,\n displayName: info.displayName,\n scopeName: `text.${dialect}`,\n aliases: [info.extension],\n fileTypes: [info.extension],\n patterns: Arr.map(linePatterns(info), encode),\n repository: Rec.map({ head: head(info), ...REPOSITORY }, encode),\n }\n}\n","/**\n * TextMate grammars for Cosense notation: `.csn` and, with component lines, `.csnx`.\n *\n * Each export is a Shiki `LanguageRegistration` as it stands, and the same objects are\n * published as `.tmLanguage.json` for editors that read TextMate grammars.\n */\nimport { buildGrammar, type Grammar } from \"./grammar\"\n\nexport type { Dialect, Grammar, Rule } from \"./grammar\"\nexport { type Notation, SCOPES } from \"./scopes\"\n\nexport const cosense: Grammar = buildGrammar(\"cosense\")\n\nexport const cosenseX: Grammar = buildGrammar(\"cosense-x\")\n"],"mappings":";;;;;;;;;;AAcA,MAAa,SAAS;CACpB,OAAO;CACP,MAAM;CACN,aAAa;CACb,cAAc;CACd,SAAS;CACT,MAAM;CACN,WAAW;CACX,SAAS;CACT,M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,SAAS,CAAC;CAC9B,OAAO,KAAK,QAAQ,OAAO,CAAC;CAC5B,OAAO,KAAK,QAAQ,QAAQ,CAAC;AAC/B,CAAC;AAEH,MAAa,gBAAgB,YAA8B;CACzD,MAAM,OAAO,SAAS;CACtB,OAAO;EACL,MAAM;EACN,aAAa,KAAK;EAClB,WAAW,QAAQ;EACnB,SAAS,CAAC,KAAK,SAAS;EACxB,WAAW,CAAC,KAAK,SAAS;EAC1B,UAAUA,MAAI,IAAI,aAAa,IAAI,GAAG,MAAM;EAC5C,YAAYC,OAAI,IAAI;GAAE,MAAM,KAAK,IAAI;GAAG,GAAG;EAAW,GAAG,MAAM;CACjE;AACF;;;;;;;;;AC9iBA,MAAa,UAAmB,aAAa,SAAS;AAEtD,MAAa,WAAoB,aAAa,WAAW"}
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
{
|
|
22
22
|
"include": "#component"
|
|
23
23
|
},
|
|
24
|
+
{
|
|
25
|
+
"include": "#command"
|
|
26
|
+
},
|
|
24
27
|
{
|
|
25
28
|
"include": "#quote"
|
|
26
29
|
},
|
|
@@ -165,6 +168,14 @@
|
|
|
165
168
|
}
|
|
166
169
|
]
|
|
167
170
|
},
|
|
171
|
+
"command": {
|
|
172
|
+
"match": "^[ \\t\\u3000]*([$%] .+)$",
|
|
173
|
+
"captures": {
|
|
174
|
+
"1": {
|
|
175
|
+
"name": "markup.inline.raw.cosense"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
168
179
|
"quote": {
|
|
169
180
|
"name": "markup.quote.cosense",
|
|
170
181
|
"begin": "^[ \\t\\u3000]*(>[> ]*)",
|
|
@@ -184,11 +195,11 @@
|
|
|
184
195
|
"patterns": [
|
|
185
196
|
{
|
|
186
197
|
"name": "markup.underline.link.image.cosense",
|
|
187
|
-
"match": "\\[\\[(?:(?:(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*)|(?:(?i:https?)://[^\\s\\[\\]?#]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#][^\\s\\[\\]]*)?)|(?:(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif))|(?:(?!\\]\\]).)*?\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#](?:(?!\\]\\]).)*)?)\\]\\]"
|
|
198
|
+
"match": "\\[\\[(?!(?:(?!\\]\\])[^\\x60])*\\x60.*\\x60)(?:(?:(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*)|(?:(?i:https?)://[^\\s\\[\\]?#]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#][^\\s\\[\\]]*)?)|(?:(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif))|(?:(?!\\]\\]).)*?\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#](?:(?!\\]\\]).)*)?)\\]\\]"
|
|
188
199
|
},
|
|
189
200
|
{
|
|
190
201
|
"name": "markup.bold.cosense",
|
|
191
|
-
"match": "\\[\\[((?:(?!\\]\\]).)+)\\]\\]",
|
|
202
|
+
"match": "\\[\\[(?!(?:(?!\\]\\])[^\\x60])*\\x60.*\\x60)((?:(?!\\]\\]).)+)\\]\\]",
|
|
192
203
|
"captures": {
|
|
193
204
|
"1": {
|
|
194
205
|
"patterns": [
|
|
@@ -201,7 +212,7 @@
|
|
|
201
212
|
},
|
|
202
213
|
{
|
|
203
214
|
"name": "constant.other.formula.cosense",
|
|
204
|
-
"begin": "\\[(?=\\$)(?=.*\\])",
|
|
215
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=\\$)(?=.*\\])",
|
|
205
216
|
"end": "\\]|(?=$)",
|
|
206
217
|
"patterns": [
|
|
207
218
|
{
|
|
@@ -210,7 +221,7 @@
|
|
|
210
221
|
]
|
|
211
222
|
},
|
|
212
223
|
{
|
|
213
|
-
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
224
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
214
225
|
"end": "\\]|(?=$)",
|
|
215
226
|
"patterns": [
|
|
216
227
|
{
|
|
@@ -223,7 +234,7 @@
|
|
|
223
234
|
},
|
|
224
235
|
{
|
|
225
236
|
"name": "markup.underline.cosense",
|
|
226
|
-
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
237
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
227
238
|
"end": "\\]|(?=$)",
|
|
228
239
|
"patterns": [
|
|
229
240
|
{
|
|
@@ -236,7 +247,7 @@
|
|
|
236
247
|
},
|
|
237
248
|
{
|
|
238
249
|
"name": "markup.strikethrough.cosense",
|
|
239
|
-
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
250
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
240
251
|
"end": "\\]|(?=$)",
|
|
241
252
|
"patterns": [
|
|
242
253
|
{
|
|
@@ -249,7 +260,7 @@
|
|
|
249
260
|
},
|
|
250
261
|
{
|
|
251
262
|
"name": "markup.underline.cosense markup.strikethrough.cosense",
|
|
252
|
-
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
263
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
253
264
|
"end": "\\]|(?=$)",
|
|
254
265
|
"patterns": [
|
|
255
266
|
{
|
|
@@ -262,7 +273,7 @@
|
|
|
262
273
|
},
|
|
263
274
|
{
|
|
264
275
|
"name": "markup.italic.cosense",
|
|
265
|
-
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
276
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
266
277
|
"end": "\\]|(?=$)",
|
|
267
278
|
"patterns": [
|
|
268
279
|
{
|
|
@@ -275,7 +286,7 @@
|
|
|
275
286
|
},
|
|
276
287
|
{
|
|
277
288
|
"name": "markup.underline.cosense markup.italic.cosense",
|
|
278
|
-
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
289
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
279
290
|
"end": "\\]|(?=$)",
|
|
280
291
|
"patterns": [
|
|
281
292
|
{
|
|
@@ -288,7 +299,7 @@
|
|
|
288
299
|
},
|
|
289
300
|
{
|
|
290
301
|
"name": "markup.strikethrough.cosense markup.italic.cosense",
|
|
291
|
-
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
302
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
292
303
|
"end": "\\]|(?=$)",
|
|
293
304
|
"patterns": [
|
|
294
305
|
{
|
|
@@ -301,7 +312,7 @@
|
|
|
301
312
|
},
|
|
302
313
|
{
|
|
303
314
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.italic.cosense",
|
|
304
|
-
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
315
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
305
316
|
"end": "\\]|(?=$)",
|
|
306
317
|
"patterns": [
|
|
307
318
|
{
|
|
@@ -314,7 +325,7 @@
|
|
|
314
325
|
},
|
|
315
326
|
{
|
|
316
327
|
"name": "markup.bold.cosense",
|
|
317
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
328
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
318
329
|
"end": "\\]|(?=$)",
|
|
319
330
|
"patterns": [
|
|
320
331
|
{
|
|
@@ -327,7 +338,7 @@
|
|
|
327
338
|
},
|
|
328
339
|
{
|
|
329
340
|
"name": "markup.underline.cosense markup.bold.cosense",
|
|
330
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
341
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
331
342
|
"end": "\\]|(?=$)",
|
|
332
343
|
"patterns": [
|
|
333
344
|
{
|
|
@@ -340,7 +351,7 @@
|
|
|
340
351
|
},
|
|
341
352
|
{
|
|
342
353
|
"name": "markup.strikethrough.cosense markup.bold.cosense",
|
|
343
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
354
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
344
355
|
"end": "\\]|(?=$)",
|
|
345
356
|
"patterns": [
|
|
346
357
|
{
|
|
@@ -353,7 +364,7 @@
|
|
|
353
364
|
},
|
|
354
365
|
{
|
|
355
366
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.bold.cosense",
|
|
356
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
367
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
357
368
|
"end": "\\]|(?=$)",
|
|
358
369
|
"patterns": [
|
|
359
370
|
{
|
|
@@ -366,7 +377,7 @@
|
|
|
366
377
|
},
|
|
367
378
|
{
|
|
368
379
|
"name": "markup.italic.cosense markup.bold.cosense",
|
|
369
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
380
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
370
381
|
"end": "\\]|(?=$)",
|
|
371
382
|
"patterns": [
|
|
372
383
|
{
|
|
@@ -379,7 +390,7 @@
|
|
|
379
390
|
},
|
|
380
391
|
{
|
|
381
392
|
"name": "markup.underline.cosense markup.italic.cosense markup.bold.cosense",
|
|
382
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
393
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
383
394
|
"end": "\\]|(?=$)",
|
|
384
395
|
"patterns": [
|
|
385
396
|
{
|
|
@@ -392,7 +403,7 @@
|
|
|
392
403
|
},
|
|
393
404
|
{
|
|
394
405
|
"name": "markup.strikethrough.cosense markup.italic.cosense markup.bold.cosense",
|
|
395
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
406
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
396
407
|
"end": "\\]|(?=$)",
|
|
397
408
|
"patterns": [
|
|
398
409
|
{
|
|
@@ -405,7 +416,7 @@
|
|
|
405
416
|
},
|
|
406
417
|
{
|
|
407
418
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.italic.cosense markup.bold.cosense",
|
|
408
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
419
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
409
420
|
"end": "\\]|(?=$)",
|
|
410
421
|
"patterns": [
|
|
411
422
|
{
|
|
@@ -418,7 +429,7 @@
|
|
|
418
429
|
},
|
|
419
430
|
{
|
|
420
431
|
"name": "markup.bold.level2.cosense",
|
|
421
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
432
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
422
433
|
"end": "\\]|(?=$)",
|
|
423
434
|
"patterns": [
|
|
424
435
|
{
|
|
@@ -431,7 +442,7 @@
|
|
|
431
442
|
},
|
|
432
443
|
{
|
|
433
444
|
"name": "markup.underline.cosense markup.bold.level2.cosense",
|
|
434
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
445
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
435
446
|
"end": "\\]|(?=$)",
|
|
436
447
|
"patterns": [
|
|
437
448
|
{
|
|
@@ -444,7 +455,7 @@
|
|
|
444
455
|
},
|
|
445
456
|
{
|
|
446
457
|
"name": "markup.strikethrough.cosense markup.bold.level2.cosense",
|
|
447
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
458
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
448
459
|
"end": "\\]|(?=$)",
|
|
449
460
|
"patterns": [
|
|
450
461
|
{
|
|
@@ -457,7 +468,7 @@
|
|
|
457
468
|
},
|
|
458
469
|
{
|
|
459
470
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.bold.level2.cosense",
|
|
460
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
471
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
461
472
|
"end": "\\]|(?=$)",
|
|
462
473
|
"patterns": [
|
|
463
474
|
{
|
|
@@ -470,7 +481,7 @@
|
|
|
470
481
|
},
|
|
471
482
|
{
|
|
472
483
|
"name": "markup.italic.cosense markup.bold.level2.cosense",
|
|
473
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
484
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
474
485
|
"end": "\\]|(?=$)",
|
|
475
486
|
"patterns": [
|
|
476
487
|
{
|
|
@@ -483,7 +494,7 @@
|
|
|
483
494
|
},
|
|
484
495
|
{
|
|
485
496
|
"name": "markup.underline.cosense markup.italic.cosense markup.bold.level2.cosense",
|
|
486
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
497
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
487
498
|
"end": "\\]|(?=$)",
|
|
488
499
|
"patterns": [
|
|
489
500
|
{
|
|
@@ -496,7 +507,7 @@
|
|
|
496
507
|
},
|
|
497
508
|
{
|
|
498
509
|
"name": "markup.strikethrough.cosense markup.italic.cosense markup.bold.level2.cosense",
|
|
499
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
510
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
500
511
|
"end": "\\]|(?=$)",
|
|
501
512
|
"patterns": [
|
|
502
513
|
{
|
|
@@ -509,7 +520,7 @@
|
|
|
509
520
|
},
|
|
510
521
|
{
|
|
511
522
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.italic.cosense markup.bold.level2.cosense",
|
|
512
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
523
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
513
524
|
"end": "\\]|(?=$)",
|
|
514
525
|
"patterns": [
|
|
515
526
|
{
|
|
@@ -522,7 +533,7 @@
|
|
|
522
533
|
},
|
|
523
534
|
{
|
|
524
535
|
"name": "markup.bold.level3.cosense",
|
|
525
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
536
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
526
537
|
"end": "\\]|(?=$)",
|
|
527
538
|
"patterns": [
|
|
528
539
|
{
|
|
@@ -535,7 +546,7 @@
|
|
|
535
546
|
},
|
|
536
547
|
{
|
|
537
548
|
"name": "markup.underline.cosense markup.bold.level3.cosense",
|
|
538
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
549
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
539
550
|
"end": "\\]|(?=$)",
|
|
540
551
|
"patterns": [
|
|
541
552
|
{
|
|
@@ -548,7 +559,7 @@
|
|
|
548
559
|
},
|
|
549
560
|
{
|
|
550
561
|
"name": "markup.strikethrough.cosense markup.bold.level3.cosense",
|
|
551
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
562
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
552
563
|
"end": "\\]|(?=$)",
|
|
553
564
|
"patterns": [
|
|
554
565
|
{
|
|
@@ -561,7 +572,7 @@
|
|
|
561
572
|
},
|
|
562
573
|
{
|
|
563
574
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.bold.level3.cosense",
|
|
564
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
575
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
565
576
|
"end": "\\]|(?=$)",
|
|
566
577
|
"patterns": [
|
|
567
578
|
{
|
|
@@ -574,7 +585,7 @@
|
|
|
574
585
|
},
|
|
575
586
|
{
|
|
576
587
|
"name": "markup.italic.cosense markup.bold.level3.cosense",
|
|
577
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
588
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
578
589
|
"end": "\\]|(?=$)",
|
|
579
590
|
"patterns": [
|
|
580
591
|
{
|
|
@@ -587,7 +598,7 @@
|
|
|
587
598
|
},
|
|
588
599
|
{
|
|
589
600
|
"name": "markup.underline.cosense markup.italic.cosense markup.bold.level3.cosense",
|
|
590
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
601
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
591
602
|
"end": "\\]|(?=$)",
|
|
592
603
|
"patterns": [
|
|
593
604
|
{
|
|
@@ -600,7 +611,7 @@
|
|
|
600
611
|
},
|
|
601
612
|
{
|
|
602
613
|
"name": "markup.strikethrough.cosense markup.italic.cosense markup.bold.level3.cosense",
|
|
603
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
614
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
604
615
|
"end": "\\]|(?=$)",
|
|
605
616
|
"patterns": [
|
|
606
617
|
{
|
|
@@ -613,7 +624,7 @@
|
|
|
613
624
|
},
|
|
614
625
|
{
|
|
615
626
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.italic.cosense markup.bold.level3.cosense",
|
|
616
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
627
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
617
628
|
"end": "\\]|(?=$)",
|
|
618
629
|
"patterns": [
|
|
619
630
|
{
|
|
@@ -626,27 +637,27 @@
|
|
|
626
637
|
},
|
|
627
638
|
{
|
|
628
639
|
"name": "string.other.link.icon.cosense",
|
|
629
|
-
"match": "\\[[^\\[\\]]+\\.icon(?:\\*\\d+)?\\]"
|
|
640
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)[^\\[\\]]+\\.icon(?:\\*\\d+)?\\]"
|
|
630
641
|
},
|
|
631
642
|
{
|
|
632
643
|
"name": "markup.underline.link.image.cosense",
|
|
633
|
-
"match": "\\[\\s*(?:(?i:https?)://[^\\s\\[\\]]+\\s+)*(?:(?:(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*)|(?:(?i:https?)://[^\\s\\[\\]?#]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#][^\\s\\[\\]]*)?)|(?:(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)))(?=[\\s\\]])(?:\\s+(?i:https?)://[^\\s\\[\\]]+)*\\s*\\]"
|
|
644
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)\\s*(?:(?i:https?)://[^\\s\\[\\]]+\\s+)*(?:(?:(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*)|(?:(?i:https?)://[^\\s\\[\\]?#]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#][^\\s\\[\\]]*)?)|(?:(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)))(?=[\\s\\]])(?:\\s+(?i:https?)://[^\\s\\[\\]]+)*\\s*\\]"
|
|
634
645
|
},
|
|
635
646
|
{
|
|
636
647
|
"name": "markup.underline.link.external.cosense",
|
|
637
|
-
"match": "\\[[^\\[\\]]*(?i:https?)://[^\\s\\[\\]]+[^\\[\\]]*\\]"
|
|
648
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)[^\\[\\]]*(?i:https?)://[^\\s\\[\\]]+[^\\[\\]]*\\]"
|
|
638
649
|
},
|
|
639
650
|
{
|
|
640
651
|
"name": "markup.underline.link.image.cosense",
|
|
641
|
-
"match": "\\[[^\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)\\]"
|
|
652
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)[^\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)\\]"
|
|
642
653
|
},
|
|
643
654
|
{
|
|
644
655
|
"name": "string.other.link.project.cosense",
|
|
645
|
-
"match": "\\[/[^\\[\\]]*\\]"
|
|
656
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)/[^\\[\\]]*\\]"
|
|
646
657
|
},
|
|
647
658
|
{
|
|
648
659
|
"name": "string.other.link.internal.cosense",
|
|
649
|
-
"match": "\\[(?=[^\\[\\]]*[^\\s\\[\\]])[^\\[\\]]+\\]"
|
|
660
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=[^\\[\\]]*[^\\s\\[\\]])[^\\[\\]]+\\]"
|
|
650
661
|
},
|
|
651
662
|
{
|
|
652
663
|
"name": "markup.inline.raw.cosense",
|
|
@@ -666,11 +677,11 @@
|
|
|
666
677
|
"patterns": [
|
|
667
678
|
{
|
|
668
679
|
"name": "markup.underline.link.image.cosense",
|
|
669
|
-
"match": "\\[\\[(?:(?:(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*)|(?:(?i:https?)://[^\\s\\[\\]?#]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#][^\\s\\[\\]]*)?)|(?:(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif))|(?:(?!\\]\\]).)*?\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#](?:(?!\\]\\]).)*)?)\\]\\]"
|
|
680
|
+
"match": "\\[\\[(?!(?:(?!\\]\\])[^\\x60])*\\x60.*\\x60)(?:(?:(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*)|(?:(?i:https?)://[^\\s\\[\\]?#]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#][^\\s\\[\\]]*)?)|(?:(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif))|(?:(?!\\]\\]).)*?\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#](?:(?!\\]\\]).)*)?)\\]\\]"
|
|
670
681
|
},
|
|
671
682
|
{
|
|
672
683
|
"name": "markup.bold.cosense",
|
|
673
|
-
"match": "\\[\\[((?:(?!\\]\\]).)+)\\]\\]",
|
|
684
|
+
"match": "\\[\\[(?!(?:(?!\\]\\])[^\\x60])*\\x60.*\\x60)((?:(?!\\]\\]).)+)\\]\\]",
|
|
674
685
|
"captures": {
|
|
675
686
|
"1": {
|
|
676
687
|
"patterns": [
|
|
@@ -683,7 +694,7 @@
|
|
|
683
694
|
},
|
|
684
695
|
{
|
|
685
696
|
"name": "constant.other.formula.cosense",
|
|
686
|
-
"begin": "\\[(?=\\$)(?=.*\\])",
|
|
697
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=\\$)(?=.*\\])",
|
|
687
698
|
"end": "\\]|(?=$)",
|
|
688
699
|
"patterns": [
|
|
689
700
|
{
|
|
@@ -693,23 +704,23 @@
|
|
|
693
704
|
},
|
|
694
705
|
{
|
|
695
706
|
"name": "string.other.link.icon.cosense",
|
|
696
|
-
"match": "\\[[^\\[\\]]+\\.icon(?:\\*\\d+)?\\]"
|
|
707
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)[^\\[\\]]+\\.icon(?:\\*\\d+)?\\]"
|
|
697
708
|
},
|
|
698
709
|
{
|
|
699
710
|
"name": "markup.underline.link.image.cosense",
|
|
700
|
-
"match": "\\[\\s*(?:(?i:https?)://[^\\s\\[\\]]+\\s+)*(?:(?:(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*)|(?:(?i:https?)://[^\\s\\[\\]?#]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#][^\\s\\[\\]]*)?)|(?:(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)))(?=[\\s\\]])(?:\\s+(?i:https?)://[^\\s\\[\\]]+)*\\s*\\]"
|
|
711
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)\\s*(?:(?i:https?)://[^\\s\\[\\]]+\\s+)*(?:(?:(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*)|(?:(?i:https?)://[^\\s\\[\\]?#]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#][^\\s\\[\\]]*)?)|(?:(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)))(?=[\\s\\]])(?:\\s+(?i:https?)://[^\\s\\[\\]]+)*\\s*\\]"
|
|
701
712
|
},
|
|
702
713
|
{
|
|
703
714
|
"name": "markup.underline.link.external.cosense",
|
|
704
|
-
"match": "\\[[^\\[\\]]*(?i:https?)://[^\\s\\[\\]]+[^\\[\\]]*\\]"
|
|
715
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)[^\\[\\]]*(?i:https?)://[^\\s\\[\\]]+[^\\[\\]]*\\]"
|
|
705
716
|
},
|
|
706
717
|
{
|
|
707
718
|
"name": "string.other.link.project.cosense",
|
|
708
|
-
"match": "\\[/[^\\[\\]]*\\]"
|
|
719
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)/[^\\[\\]]*\\]"
|
|
709
720
|
},
|
|
710
721
|
{
|
|
711
722
|
"name": "string.other.link.internal.cosense",
|
|
712
|
-
"match": "\\[(?=[^\\[\\]]*[^\\s\\[\\]])[^\\[\\]]+\\]"
|
|
723
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=[^\\[\\]]*[^\\s\\[\\]])[^\\[\\]]+\\]"
|
|
713
724
|
},
|
|
714
725
|
{
|
|
715
726
|
"name": "markup.inline.raw.cosense",
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
{
|
|
19
19
|
"include": "#table-block"
|
|
20
20
|
},
|
|
21
|
+
{
|
|
22
|
+
"include": "#command"
|
|
23
|
+
},
|
|
21
24
|
{
|
|
22
25
|
"include": "#quote"
|
|
23
26
|
},
|
|
@@ -162,6 +165,14 @@
|
|
|
162
165
|
}
|
|
163
166
|
]
|
|
164
167
|
},
|
|
168
|
+
"command": {
|
|
169
|
+
"match": "^[ \\t\\u3000]*([$%] .+)$",
|
|
170
|
+
"captures": {
|
|
171
|
+
"1": {
|
|
172
|
+
"name": "markup.inline.raw.cosense"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
165
176
|
"quote": {
|
|
166
177
|
"name": "markup.quote.cosense",
|
|
167
178
|
"begin": "^[ \\t\\u3000]*(>[> ]*)",
|
|
@@ -181,11 +192,11 @@
|
|
|
181
192
|
"patterns": [
|
|
182
193
|
{
|
|
183
194
|
"name": "markup.underline.link.image.cosense",
|
|
184
|
-
"match": "\\[\\[(?:(?:(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*)|(?:(?i:https?)://[^\\s\\[\\]?#]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#][^\\s\\[\\]]*)?)|(?:(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif))|(?:(?!\\]\\]).)*?\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#](?:(?!\\]\\]).)*)?)\\]\\]"
|
|
195
|
+
"match": "\\[\\[(?!(?:(?!\\]\\])[^\\x60])*\\x60.*\\x60)(?:(?:(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*)|(?:(?i:https?)://[^\\s\\[\\]?#]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#][^\\s\\[\\]]*)?)|(?:(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif))|(?:(?!\\]\\]).)*?\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#](?:(?!\\]\\]).)*)?)\\]\\]"
|
|
185
196
|
},
|
|
186
197
|
{
|
|
187
198
|
"name": "markup.bold.cosense",
|
|
188
|
-
"match": "\\[\\[((?:(?!\\]\\]).)+)\\]\\]",
|
|
199
|
+
"match": "\\[\\[(?!(?:(?!\\]\\])[^\\x60])*\\x60.*\\x60)((?:(?!\\]\\]).)+)\\]\\]",
|
|
189
200
|
"captures": {
|
|
190
201
|
"1": {
|
|
191
202
|
"patterns": [
|
|
@@ -198,7 +209,7 @@
|
|
|
198
209
|
},
|
|
199
210
|
{
|
|
200
211
|
"name": "constant.other.formula.cosense",
|
|
201
|
-
"begin": "\\[(?=\\$)(?=.*\\])",
|
|
212
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=\\$)(?=.*\\])",
|
|
202
213
|
"end": "\\]|(?=$)",
|
|
203
214
|
"patterns": [
|
|
204
215
|
{
|
|
@@ -207,7 +218,7 @@
|
|
|
207
218
|
]
|
|
208
219
|
},
|
|
209
220
|
{
|
|
210
|
-
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
221
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
211
222
|
"end": "\\]|(?=$)",
|
|
212
223
|
"patterns": [
|
|
213
224
|
{
|
|
@@ -220,7 +231,7 @@
|
|
|
220
231
|
},
|
|
221
232
|
{
|
|
222
233
|
"name": "markup.underline.cosense",
|
|
223
|
-
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
234
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
224
235
|
"end": "\\]|(?=$)",
|
|
225
236
|
"patterns": [
|
|
226
237
|
{
|
|
@@ -233,7 +244,7 @@
|
|
|
233
244
|
},
|
|
234
245
|
{
|
|
235
246
|
"name": "markup.strikethrough.cosense",
|
|
236
|
-
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
247
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
237
248
|
"end": "\\]|(?=$)",
|
|
238
249
|
"patterns": [
|
|
239
250
|
{
|
|
@@ -246,7 +257,7 @@
|
|
|
246
257
|
},
|
|
247
258
|
{
|
|
248
259
|
"name": "markup.underline.cosense markup.strikethrough.cosense",
|
|
249
|
-
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
260
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
250
261
|
"end": "\\]|(?=$)",
|
|
251
262
|
"patterns": [
|
|
252
263
|
{
|
|
@@ -259,7 +270,7 @@
|
|
|
259
270
|
},
|
|
260
271
|
{
|
|
261
272
|
"name": "markup.italic.cosense",
|
|
262
|
-
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
273
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
263
274
|
"end": "\\]|(?=$)",
|
|
264
275
|
"patterns": [
|
|
265
276
|
{
|
|
@@ -272,7 +283,7 @@
|
|
|
272
283
|
},
|
|
273
284
|
{
|
|
274
285
|
"name": "markup.underline.cosense markup.italic.cosense",
|
|
275
|
-
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
286
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
276
287
|
"end": "\\]|(?=$)",
|
|
277
288
|
"patterns": [
|
|
278
289
|
{
|
|
@@ -285,7 +296,7 @@
|
|
|
285
296
|
},
|
|
286
297
|
{
|
|
287
298
|
"name": "markup.strikethrough.cosense markup.italic.cosense",
|
|
288
|
-
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
299
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
289
300
|
"end": "\\]|(?=$)",
|
|
290
301
|
"patterns": [
|
|
291
302
|
{
|
|
@@ -298,7 +309,7 @@
|
|
|
298
309
|
},
|
|
299
310
|
{
|
|
300
311
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.italic.cosense",
|
|
301
|
-
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
312
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
302
313
|
"end": "\\]|(?=$)",
|
|
303
314
|
"patterns": [
|
|
304
315
|
{
|
|
@@ -311,7 +322,7 @@
|
|
|
311
322
|
},
|
|
312
323
|
{
|
|
313
324
|
"name": "markup.bold.cosense",
|
|
314
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
325
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
315
326
|
"end": "\\]|(?=$)",
|
|
316
327
|
"patterns": [
|
|
317
328
|
{
|
|
@@ -324,7 +335,7 @@
|
|
|
324
335
|
},
|
|
325
336
|
{
|
|
326
337
|
"name": "markup.underline.cosense markup.bold.cosense",
|
|
327
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
338
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
328
339
|
"end": "\\]|(?=$)",
|
|
329
340
|
"patterns": [
|
|
330
341
|
{
|
|
@@ -337,7 +348,7 @@
|
|
|
337
348
|
},
|
|
338
349
|
{
|
|
339
350
|
"name": "markup.strikethrough.cosense markup.bold.cosense",
|
|
340
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
351
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
341
352
|
"end": "\\]|(?=$)",
|
|
342
353
|
"patterns": [
|
|
343
354
|
{
|
|
@@ -350,7 +361,7 @@
|
|
|
350
361
|
},
|
|
351
362
|
{
|
|
352
363
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.bold.cosense",
|
|
353
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
364
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
354
365
|
"end": "\\]|(?=$)",
|
|
355
366
|
"patterns": [
|
|
356
367
|
{
|
|
@@ -363,7 +374,7 @@
|
|
|
363
374
|
},
|
|
364
375
|
{
|
|
365
376
|
"name": "markup.italic.cosense markup.bold.cosense",
|
|
366
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
377
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
367
378
|
"end": "\\]|(?=$)",
|
|
368
379
|
"patterns": [
|
|
369
380
|
{
|
|
@@ -376,7 +387,7 @@
|
|
|
376
387
|
},
|
|
377
388
|
{
|
|
378
389
|
"name": "markup.underline.cosense markup.italic.cosense markup.bold.cosense",
|
|
379
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
390
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
380
391
|
"end": "\\]|(?=$)",
|
|
381
392
|
"patterns": [
|
|
382
393
|
{
|
|
@@ -389,7 +400,7 @@
|
|
|
389
400
|
},
|
|
390
401
|
{
|
|
391
402
|
"name": "markup.strikethrough.cosense markup.italic.cosense markup.bold.cosense",
|
|
392
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
403
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
393
404
|
"end": "\\]|(?=$)",
|
|
394
405
|
"patterns": [
|
|
395
406
|
{
|
|
@@ -402,7 +413,7 @@
|
|
|
402
413
|
},
|
|
403
414
|
{
|
|
404
415
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.italic.cosense markup.bold.cosense",
|
|
405
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
416
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
406
417
|
"end": "\\]|(?=$)",
|
|
407
418
|
"patterns": [
|
|
408
419
|
{
|
|
@@ -415,7 +426,7 @@
|
|
|
415
426
|
},
|
|
416
427
|
{
|
|
417
428
|
"name": "markup.bold.level2.cosense",
|
|
418
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
429
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
419
430
|
"end": "\\]|(?=$)",
|
|
420
431
|
"patterns": [
|
|
421
432
|
{
|
|
@@ -428,7 +439,7 @@
|
|
|
428
439
|
},
|
|
429
440
|
{
|
|
430
441
|
"name": "markup.underline.cosense markup.bold.level2.cosense",
|
|
431
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
442
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
432
443
|
"end": "\\]|(?=$)",
|
|
433
444
|
"patterns": [
|
|
434
445
|
{
|
|
@@ -441,7 +452,7 @@
|
|
|
441
452
|
},
|
|
442
453
|
{
|
|
443
454
|
"name": "markup.strikethrough.cosense markup.bold.level2.cosense",
|
|
444
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
455
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
445
456
|
"end": "\\]|(?=$)",
|
|
446
457
|
"patterns": [
|
|
447
458
|
{
|
|
@@ -454,7 +465,7 @@
|
|
|
454
465
|
},
|
|
455
466
|
{
|
|
456
467
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.bold.level2.cosense",
|
|
457
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
468
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
458
469
|
"end": "\\]|(?=$)",
|
|
459
470
|
"patterns": [
|
|
460
471
|
{
|
|
@@ -467,7 +478,7 @@
|
|
|
467
478
|
},
|
|
468
479
|
{
|
|
469
480
|
"name": "markup.italic.cosense markup.bold.level2.cosense",
|
|
470
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
481
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
471
482
|
"end": "\\]|(?=$)",
|
|
472
483
|
"patterns": [
|
|
473
484
|
{
|
|
@@ -480,7 +491,7 @@
|
|
|
480
491
|
},
|
|
481
492
|
{
|
|
482
493
|
"name": "markup.underline.cosense markup.italic.cosense markup.bold.level2.cosense",
|
|
483
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
494
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
484
495
|
"end": "\\]|(?=$)",
|
|
485
496
|
"patterns": [
|
|
486
497
|
{
|
|
@@ -493,7 +504,7 @@
|
|
|
493
504
|
},
|
|
494
505
|
{
|
|
495
506
|
"name": "markup.strikethrough.cosense markup.italic.cosense markup.bold.level2.cosense",
|
|
496
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
507
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
497
508
|
"end": "\\]|(?=$)",
|
|
498
509
|
"patterns": [
|
|
499
510
|
{
|
|
@@ -506,7 +517,7 @@
|
|
|
506
517
|
},
|
|
507
518
|
{
|
|
508
519
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.italic.cosense markup.bold.level2.cosense",
|
|
509
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
520
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
510
521
|
"end": "\\]|(?=$)",
|
|
511
522
|
"patterns": [
|
|
512
523
|
{
|
|
@@ -519,7 +530,7 @@
|
|
|
519
530
|
},
|
|
520
531
|
{
|
|
521
532
|
"name": "markup.bold.level3.cosense",
|
|
522
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
533
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
523
534
|
"end": "\\]|(?=$)",
|
|
524
535
|
"patterns": [
|
|
525
536
|
{
|
|
@@ -532,7 +543,7 @@
|
|
|
532
543
|
},
|
|
533
544
|
{
|
|
534
545
|
"name": "markup.underline.cosense markup.bold.level3.cosense",
|
|
535
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
546
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
536
547
|
"end": "\\]|(?=$)",
|
|
537
548
|
"patterns": [
|
|
538
549
|
{
|
|
@@ -545,7 +556,7 @@
|
|
|
545
556
|
},
|
|
546
557
|
{
|
|
547
558
|
"name": "markup.strikethrough.cosense markup.bold.level3.cosense",
|
|
548
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
559
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
549
560
|
"end": "\\]|(?=$)",
|
|
550
561
|
"patterns": [
|
|
551
562
|
{
|
|
@@ -558,7 +569,7 @@
|
|
|
558
569
|
},
|
|
559
570
|
{
|
|
560
571
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.bold.level3.cosense",
|
|
561
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
572
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
562
573
|
"end": "\\]|(?=$)",
|
|
563
574
|
"patterns": [
|
|
564
575
|
{
|
|
@@ -571,7 +582,7 @@
|
|
|
571
582
|
},
|
|
572
583
|
{
|
|
573
584
|
"name": "markup.italic.cosense markup.bold.level3.cosense",
|
|
574
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
585
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
575
586
|
"end": "\\]|(?=$)",
|
|
576
587
|
"patterns": [
|
|
577
588
|
{
|
|
@@ -584,7 +595,7 @@
|
|
|
584
595
|
},
|
|
585
596
|
{
|
|
586
597
|
"name": "markup.underline.cosense markup.italic.cosense markup.bold.level3.cosense",
|
|
587
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
598
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
588
599
|
"end": "\\]|(?=$)",
|
|
589
600
|
"patterns": [
|
|
590
601
|
{
|
|
@@ -597,7 +608,7 @@
|
|
|
597
608
|
},
|
|
598
609
|
{
|
|
599
610
|
"name": "markup.strikethrough.cosense markup.italic.cosense markup.bold.level3.cosense",
|
|
600
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
611
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
601
612
|
"end": "\\]|(?=$)",
|
|
602
613
|
"patterns": [
|
|
603
614
|
{
|
|
@@ -610,7 +621,7 @@
|
|
|
610
621
|
},
|
|
611
622
|
{
|
|
612
623
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.italic.cosense markup.bold.level3.cosense",
|
|
613
|
-
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
624
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
614
625
|
"end": "\\]|(?=$)",
|
|
615
626
|
"patterns": [
|
|
616
627
|
{
|
|
@@ -623,27 +634,27 @@
|
|
|
623
634
|
},
|
|
624
635
|
{
|
|
625
636
|
"name": "string.other.link.icon.cosense",
|
|
626
|
-
"match": "\\[[^\\[\\]]+\\.icon(?:\\*\\d+)?\\]"
|
|
637
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)[^\\[\\]]+\\.icon(?:\\*\\d+)?\\]"
|
|
627
638
|
},
|
|
628
639
|
{
|
|
629
640
|
"name": "markup.underline.link.image.cosense",
|
|
630
|
-
"match": "\\[\\s*(?:(?i:https?)://[^\\s\\[\\]]+\\s+)*(?:(?:(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*)|(?:(?i:https?)://[^\\s\\[\\]?#]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#][^\\s\\[\\]]*)?)|(?:(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)))(?=[\\s\\]])(?:\\s+(?i:https?)://[^\\s\\[\\]]+)*\\s*\\]"
|
|
641
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)\\s*(?:(?i:https?)://[^\\s\\[\\]]+\\s+)*(?:(?:(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*)|(?:(?i:https?)://[^\\s\\[\\]?#]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#][^\\s\\[\\]]*)?)|(?:(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)))(?=[\\s\\]])(?:\\s+(?i:https?)://[^\\s\\[\\]]+)*\\s*\\]"
|
|
631
642
|
},
|
|
632
643
|
{
|
|
633
644
|
"name": "markup.underline.link.external.cosense",
|
|
634
|
-
"match": "\\[[^\\[\\]]*(?i:https?)://[^\\s\\[\\]]+[^\\[\\]]*\\]"
|
|
645
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)[^\\[\\]]*(?i:https?)://[^\\s\\[\\]]+[^\\[\\]]*\\]"
|
|
635
646
|
},
|
|
636
647
|
{
|
|
637
648
|
"name": "markup.underline.link.image.cosense",
|
|
638
|
-
"match": "\\[[^\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)\\]"
|
|
649
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)[^\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)\\]"
|
|
639
650
|
},
|
|
640
651
|
{
|
|
641
652
|
"name": "string.other.link.project.cosense",
|
|
642
|
-
"match": "\\[/[^\\[\\]]*\\]"
|
|
653
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)/[^\\[\\]]*\\]"
|
|
643
654
|
},
|
|
644
655
|
{
|
|
645
656
|
"name": "string.other.link.internal.cosense",
|
|
646
|
-
"match": "\\[(?=[^\\[\\]]*[^\\s\\[\\]])[^\\[\\]]+\\]"
|
|
657
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=[^\\[\\]]*[^\\s\\[\\]])[^\\[\\]]+\\]"
|
|
647
658
|
},
|
|
648
659
|
{
|
|
649
660
|
"name": "markup.inline.raw.cosense",
|
|
@@ -663,11 +674,11 @@
|
|
|
663
674
|
"patterns": [
|
|
664
675
|
{
|
|
665
676
|
"name": "markup.underline.link.image.cosense",
|
|
666
|
-
"match": "\\[\\[(?:(?:(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*)|(?:(?i:https?)://[^\\s\\[\\]?#]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#][^\\s\\[\\]]*)?)|(?:(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif))|(?:(?!\\]\\]).)*?\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#](?:(?!\\]\\]).)*)?)\\]\\]"
|
|
677
|
+
"match": "\\[\\[(?!(?:(?!\\]\\])[^\\x60])*\\x60.*\\x60)(?:(?:(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*)|(?:(?i:https?)://[^\\s\\[\\]?#]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#][^\\s\\[\\]]*)?)|(?:(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif))|(?:(?!\\]\\]).)*?\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#](?:(?!\\]\\]).)*)?)\\]\\]"
|
|
667
678
|
},
|
|
668
679
|
{
|
|
669
680
|
"name": "markup.bold.cosense",
|
|
670
|
-
"match": "\\[\\[((?:(?!\\]\\]).)+)\\]\\]",
|
|
681
|
+
"match": "\\[\\[(?!(?:(?!\\]\\])[^\\x60])*\\x60.*\\x60)((?:(?!\\]\\]).)+)\\]\\]",
|
|
671
682
|
"captures": {
|
|
672
683
|
"1": {
|
|
673
684
|
"patterns": [
|
|
@@ -680,7 +691,7 @@
|
|
|
680
691
|
},
|
|
681
692
|
{
|
|
682
693
|
"name": "constant.other.formula.cosense",
|
|
683
|
-
"begin": "\\[(?=\\$)(?=.*\\])",
|
|
694
|
+
"begin": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=\\$)(?=.*\\])",
|
|
684
695
|
"end": "\\]|(?=$)",
|
|
685
696
|
"patterns": [
|
|
686
697
|
{
|
|
@@ -690,23 +701,23 @@
|
|
|
690
701
|
},
|
|
691
702
|
{
|
|
692
703
|
"name": "string.other.link.icon.cosense",
|
|
693
|
-
"match": "\\[[^\\[\\]]+\\.icon(?:\\*\\d+)?\\]"
|
|
704
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)[^\\[\\]]+\\.icon(?:\\*\\d+)?\\]"
|
|
694
705
|
},
|
|
695
706
|
{
|
|
696
707
|
"name": "markup.underline.link.image.cosense",
|
|
697
|
-
"match": "\\[\\s*(?:(?i:https?)://[^\\s\\[\\]]+\\s+)*(?:(?:(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*)|(?:(?i:https?)://[^\\s\\[\\]?#]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#][^\\s\\[\\]]*)?)|(?:(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)))(?=[\\s\\]])(?:\\s+(?i:https?)://[^\\s\\[\\]]+)*\\s*\\]"
|
|
708
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)\\s*(?:(?i:https?)://[^\\s\\[\\]]+\\s+)*(?:(?:(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*)|(?:(?i:https?)://[^\\s\\[\\]?#]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)(?:[?#][^\\s\\[\\]]*)?)|(?:(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)))(?=[\\s\\]])(?:\\s+(?i:https?)://[^\\s\\[\\]]+)*\\s*\\]"
|
|
698
709
|
},
|
|
699
710
|
{
|
|
700
711
|
"name": "markup.underline.link.external.cosense",
|
|
701
|
-
"match": "\\[[^\\[\\]]*(?i:https?)://[^\\s\\[\\]]+[^\\[\\]]*\\]"
|
|
712
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)[^\\[\\]]*(?i:https?)://[^\\s\\[\\]]+[^\\[\\]]*\\]"
|
|
702
713
|
},
|
|
703
714
|
{
|
|
704
715
|
"name": "string.other.link.project.cosense",
|
|
705
|
-
"match": "\\[/[^\\[\\]]*\\]"
|
|
716
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)/[^\\[\\]]*\\]"
|
|
706
717
|
},
|
|
707
718
|
{
|
|
708
719
|
"name": "string.other.link.internal.cosense",
|
|
709
|
-
"match": "\\[(?=[^\\[\\]]*[^\\s\\[\\]])[^\\[\\]]+\\]"
|
|
720
|
+
"match": "\\[(?!(?:\\[[^\\[\\]]*\\]|[^\\]\\x60])*\\x60.*\\x60)(?=[^\\[\\]]*[^\\s\\[\\]])[^\\[\\]]+\\]"
|
|
710
721
|
},
|
|
711
722
|
{
|
|
712
723
|
"name": "markup.inline.raw.cosense",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosense-toolbox/textmate",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "TextMate grammars for Cosense notation (.csn / .csnx), ready for Shiki and VS Code.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"effect": "^3.22.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@cosense-toolbox/lsp": "0.1.0-beta.
|
|
47
|
+
"@cosense-toolbox/lsp": "0.1.0-beta.6",
|
|
48
48
|
"shiki": "^4.4.3",
|
|
49
49
|
"tsdown": "^0.22.14",
|
|
50
50
|
"typescript": "^6.0.0",
|