coc-markdownlint 1.12.3 → 1.12.4

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/lib/index.js CHANGED
@@ -20,24 +20,28 @@ var __spreadValues = (a, b) => {
20
20
  };
21
21
  var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
22
22
  var __commonJS = (cb, mod) => function __require() {
23
- return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
23
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
24
  };
25
25
  var __export = (target, all) => {
26
- __markAsModule(target);
27
26
  for (var name in all)
28
27
  __defProp(target, name, { get: all[name], enumerable: true });
29
28
  };
30
- var __reExport = (target, module2, desc) => {
29
+ var __reExport = (target, module2, copyDefault, desc) => {
31
30
  if (module2 && typeof module2 === "object" || typeof module2 === "function") {
32
31
  for (let key of __getOwnPropNames(module2))
33
- if (!__hasOwnProp.call(target, key) && key !== "default")
32
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
34
33
  __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
35
34
  }
36
35
  return target;
37
36
  };
38
- var __toModule = (module2) => {
39
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
37
+ var __toESM = (module2, isNodeMode) => {
38
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
40
39
  };
40
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
41
+ return (module2, temp) => {
42
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
43
+ };
44
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
41
45
 
42
46
  // node_modules/deep-extend/lib/deep-extend.js
43
47
  var require_deep_extend = __commonJS({
@@ -2315,7 +2319,7 @@ var require_list = __commonJS({
2315
2319
  return false;
2316
2320
  }
2317
2321
  if (silent && state.parentType === "paragraph") {
2318
- if (state.tShift[startLine] >= state.blkIndent) {
2322
+ if (state.sCount[startLine] >= state.blkIndent) {
2319
2323
  isTerminatingParagraph = true;
2320
2324
  }
2321
2325
  }
@@ -3222,7 +3226,7 @@ var require_newline = __commonJS({
3222
3226
  "use strict";
3223
3227
  var isSpace = require_utils().isSpace;
3224
3228
  module2.exports = function newline(state, silent) {
3225
- var pmax, max, pos = state.pos;
3229
+ var pmax, max, ws, pos = state.pos;
3226
3230
  if (state.src.charCodeAt(pos) !== 10) {
3227
3231
  return false;
3228
3232
  }
@@ -3231,7 +3235,10 @@ var require_newline = __commonJS({
3231
3235
  if (!silent) {
3232
3236
  if (pmax >= 0 && state.pending.charCodeAt(pmax) === 32) {
3233
3237
  if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 32) {
3234
- state.pending = state.pending.replace(/ +$/, "");
3238
+ ws = pmax - 1;
3239
+ while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 32)
3240
+ ws--;
3241
+ state.pending = state.pending.slice(0, ws);
3235
3242
  state.push("hardbreak", "br", 0);
3236
3243
  } else {
3237
3244
  state.pending = state.pending.slice(0, -1);
@@ -3383,7 +3390,6 @@ var require_strikethrough = __commonJS({
3383
3390
  state.delimiters.push({
3384
3391
  marker,
3385
3392
  length: 0,
3386
- jump: i / 2,
3387
3393
  token: state.tokens.length - 1,
3388
3394
  end: -1,
3389
3395
  open: scanned.can_open,
@@ -3465,7 +3471,6 @@ var require_emphasis = __commonJS({
3465
3471
  state.delimiters.push({
3466
3472
  marker,
3467
3473
  length: scanned.length,
3468
- jump: i,
3469
3474
  token: state.tokens.length - 1,
3470
3475
  end: -1,
3471
3476
  open: scanned.can_open,
@@ -3486,7 +3491,7 @@ var require_emphasis = __commonJS({
3486
3491
  continue;
3487
3492
  }
3488
3493
  endDelim = delimiters[startDelim.end];
3489
- isStrong = i > 0 && delimiters[i - 1].end === startDelim.end + 1 && delimiters[i - 1].token === startDelim.token - 1 && delimiters[startDelim.end + 1].token === endDelim.token + 1 && delimiters[i - 1].marker === startDelim.marker;
3494
+ isStrong = i > 0 && delimiters[i - 1].end === startDelim.end + 1 && delimiters[i - 1].marker === startDelim.marker && delimiters[i - 1].token === startDelim.token - 1 && delimiters[startDelim.end + 1].token === endDelim.token + 1;
3490
3495
  ch = String.fromCharCode(startDelim.marker);
3491
3496
  token = state.tokens[startDelim.token];
3492
3497
  token.type = isStrong ? "strong_open" : "em_open";
@@ -3892,8 +3897,18 @@ var require_balance_pairs = __commonJS({
3892
3897
  "use strict";
3893
3898
  function processDelimiters(state, delimiters) {
3894
3899
  var closerIdx, openerIdx, closer, opener, minOpenerIdx, newMinOpenerIdx, isOddMatch, lastJump, openersBottom = {}, max = delimiters.length;
3900
+ if (!max)
3901
+ return;
3902
+ var headerIdx = 0;
3903
+ var lastTokenIdx = -2;
3904
+ var jumps = [];
3895
3905
  for (closerIdx = 0; closerIdx < max; closerIdx++) {
3896
3906
  closer = delimiters[closerIdx];
3907
+ jumps.push(0);
3908
+ if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) {
3909
+ headerIdx = closerIdx;
3910
+ }
3911
+ lastTokenIdx = closer.token;
3897
3912
  closer.length = closer.length || 0;
3898
3913
  if (!closer.close)
3899
3914
  continue;
@@ -3901,11 +3916,9 @@ var require_balance_pairs = __commonJS({
3901
3916
  openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1];
3902
3917
  }
3903
3918
  minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + closer.length % 3];
3904
- openerIdx = closerIdx - closer.jump - 1;
3905
- if (openerIdx < -1)
3906
- openerIdx = -1;
3919
+ openerIdx = headerIdx - jumps[headerIdx] - 1;
3907
3920
  newMinOpenerIdx = openerIdx;
3908
- for (; openerIdx > minOpenerIdx; openerIdx -= opener.jump + 1) {
3921
+ for (; openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) {
3909
3922
  opener = delimiters[openerIdx];
3910
3923
  if (opener.marker !== closer.marker)
3911
3924
  continue;
@@ -3919,13 +3932,14 @@ var require_balance_pairs = __commonJS({
3919
3932
  }
3920
3933
  }
3921
3934
  if (!isOddMatch) {
3922
- lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? delimiters[openerIdx - 1].jump + 1 : 0;
3923
- closer.jump = closerIdx - openerIdx + lastJump;
3935
+ lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? jumps[openerIdx - 1] + 1 : 0;
3936
+ jumps[closerIdx] = closerIdx - openerIdx + lastJump;
3937
+ jumps[openerIdx] = lastJump;
3924
3938
  closer.open = false;
3925
3939
  opener.end = closerIdx;
3926
- opener.jump = lastJump;
3927
3940
  opener.close = false;
3928
3941
  newMinOpenerIdx = -1;
3942
+ lastTokenIdx = -2;
3929
3943
  break;
3930
3944
  }
3931
3945
  }
@@ -4846,90 +4860,13 @@ var require_markdown_it = __commonJS({
4846
4860
  }
4847
4861
  });
4848
4862
 
4849
- // node_modules/markdownlint/package.json
4850
- var require_package = __commonJS({
4851
- "node_modules/markdownlint/package.json"(exports, module2) {
4852
- module2.exports = {
4853
- name: "markdownlint",
4854
- version: "0.24.0",
4855
- description: "A Node.js style checker and lint tool for Markdown/CommonMark files.",
4856
- main: "lib/markdownlint.js",
4857
- types: "lib/markdownlint.d.ts",
4858
- author: "David Anson (https://dlaa.me/)",
4859
- license: "MIT",
4860
- homepage: "https://github.com/DavidAnson/markdownlint",
4861
- repository: {
4862
- type: "git",
4863
- url: "https://github.com/DavidAnson/markdownlint.git"
4864
- },
4865
- bugs: "https://github.com/DavidAnson/markdownlint/issues",
4866
- scripts: {
4867
- "build-config": "npm run build-config-schema && npm run build-config-example",
4868
- "build-config-example": "node schema/build-config-example.js",
4869
- "build-config-schema": "node schema/build-config-schema.js",
4870
- "build-declaration": "tsc --allowJs --declaration --emitDeclarationOnly --resolveJsonModule lib/markdownlint.js && rimraf 'lib/{c,md,r}*.d.ts' 'helpers/*.d.ts'",
4871
- "build-demo": "cpy node_modules/markdown-it/dist/markdown-it.min.js demo && cd demo && rimraf markdownlint-browser.* && webpack --no-stats",
4872
- "build-example": "npm install --no-save --ignore-scripts grunt grunt-cli gulp through2",
4873
- ci: "npm-run-all --continue-on-error --parallel test-cover lint declaration build-config build-demo && git diff --exit-code",
4874
- "clean-test-repos": "rimraf test-repos",
4875
- "clone-test-repos-dotnet-docs": "cd test-repos && git clone https://github.com/dotnet/docs dotnet-docs --depth 1 --no-tags --quiet",
4876
- "clone-test-repos-eslint-eslint": "cd test-repos && git clone https://github.com/eslint/eslint eslint-eslint --depth 1 --no-tags --quiet",
4877
- "clone-test-repos-mkdocs-mkdocs": "cd test-repos && git clone https://github.com/mkdocs/mkdocs mkdocs-mkdocs --depth 1 --no-tags --quiet",
4878
- "clone-test-repos-mochajs-mocha": "cd test-repos && git clone https://github.com/mochajs/mocha mochajs-mocha --depth 1 --no-tags --quiet",
4879
- "clone-test-repos-pi-hole-docs": "cd test-repos && git clone https://github.com/pi-hole/docs pi-hole-docs --depth 1 --no-tags --quiet",
4880
- "clone-test-repos-v8-v8-dev": "cd test-repos && git clone https://github.com/v8/v8.dev v8-v8-dev --depth 1 --no-tags --quiet",
4881
- "clone-test-repos-webhintio-hint": "cd test-repos && git clone https://github.com/webhintio/hint webhintio-hint --depth 1 --no-tags --quiet",
4882
- "clone-test-repos-webpack-webpack-js-org": "cd test-repos && git clone https://github.com/webpack/webpack.js.org webpack-webpack-js-org --depth 1 --no-tags --quiet",
4883
- "clone-test-repos": "mkdir test-repos && cd test-repos && npm run clone-test-repos-eslint-eslint && npm run clone-test-repos-mkdocs-mkdocs && npm run clone-test-repos-mochajs-mocha && npm run clone-test-repos-pi-hole-docs && npm run clone-test-repos-webhintio-hint && npm run clone-test-repos-webpack-webpack-js-org",
4884
- "clone-test-repos-large": "npm run clone-test-repos && cd test-repos && npm run clone-test-repos-dotnet-docs && npm run clone-test-repos-v8-v8-dev",
4885
- declaration: "npm run build-declaration && npm run test-declaration",
4886
- example: "cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint",
4887
- lint: "eslint --max-warnings 0 .",
4888
- "lint-test-repos": "ava --timeout=5m test/markdownlint-test-repos.js",
4889
- test: "ava test/markdownlint-test.js test/markdownlint-test-custom-rules.js test/markdownlint-test-helpers.js test/markdownlint-test-result-object.js test/markdownlint-test-scenarios.js",
4890
- "test-cover": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 npm test",
4891
- "test-declaration": "cd example/typescript && tsc && node type-check.js",
4892
- "test-extra": "ava --timeout=5m test/markdownlint-test-extra.js"
4893
- },
4894
- engines: {
4895
- node: ">=10"
4896
- },
4897
- dependencies: {
4898
- "markdown-it": "12.2.0"
4899
- },
4900
- devDependencies: {
4901
- ava: "~3.15.0",
4902
- c8: "~7.8.0",
4903
- "cpy-cli": "~3.1.1",
4904
- eslint: "~7.32.0",
4905
- "eslint-plugin-jsdoc": "~36.0.7",
4906
- "eslint-plugin-node": "~11.1.0",
4907
- "eslint-plugin-unicorn": "~35.0.0",
4908
- globby: "~11.0.4",
4909
- "js-yaml": "~4.1.0",
4910
- "markdown-it-for-inline": "~0.1.1",
4911
- "markdown-it-sub": "~1.0.0",
4912
- "markdown-it-sup": "~1.0.0",
4913
- "markdown-it-texmath": "~0.9.1",
4914
- "markdownlint-rule-helpers": "~0.14.0",
4915
- "npm-run-all": "~4.1.5",
4916
- rimraf: "~3.0.2",
4917
- "strip-json-comments": "~3.1.1",
4918
- toml: "~3.0.0",
4919
- "ts-loader": "~9.2.5",
4920
- tv4: "~1.3.0",
4921
- typescript: "~4.3.5",
4922
- webpack: "~5.51.1",
4923
- "webpack-cli": "~4.8.0"
4924
- },
4925
- keywords: [
4926
- "markdown",
4927
- "lint",
4928
- "md",
4929
- "CommonMark",
4930
- "markdownlint"
4931
- ]
4932
- };
4863
+ // node_modules/markdownlint/lib/constants.js
4864
+ var require_constants = __commonJS({
4865
+ "node_modules/markdownlint/lib/constants.js"(exports, module2) {
4866
+ "use strict";
4867
+ module2.exports.deprecatedRuleNames = ["MD002", "MD006"];
4868
+ module2.exports.homepage = "https://github.com/DavidAnson/markdownlint";
4869
+ module2.exports.version = "0.25.1";
4933
4870
  }
4934
4871
  });
4935
4872
 
@@ -4937,7 +4874,6 @@ var require_package = __commonJS({
4937
4874
  var require_helpers2 = __commonJS({
4938
4875
  "node_modules/markdownlint/helpers/helpers.js"(exports, module2) {
4939
4876
  "use strict";
4940
- var os = require("os");
4941
4877
  var newLineRe = /\r\n?|\n/g;
4942
4878
  module2.exports.newLineRe = newLineRe;
4943
4879
  module2.exports.frontMatterRe = /((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$)|(^\{\s*$[^]*?^\}\s*$))(\r\n|\r|\n|$)/m;
@@ -4965,9 +4901,8 @@ var require_helpers2 = __commonJS({
4965
4901
  module2.exports.isObject = function isObject2(obj) {
4966
4902
  return obj !== null && typeof obj === "object" && !Array.isArray(obj);
4967
4903
  };
4968
- var blankLineRe = />|(?:<!--.*?-->)/g;
4969
4904
  module2.exports.isBlankLine = function isBlankLine(line) {
4970
- return !line || !line.trim() || !line.replace(blankLineRe, "").trim();
4905
+ return !line || !line.trim() || !line.replace(/<!--.*?-->/g, "").replace(/<!--.*$/g, "").replace(/^.*-->/g, "").replace(/>/g, "").trim();
4971
4906
  };
4972
4907
  module2.exports.numericSortAscending = function numericSortAscending(a, b) {
4973
4908
  return a - b;
@@ -5038,6 +4973,14 @@ var require_helpers2 = __commonJS({
5038
4973
  return "backtick";
5039
4974
  }
5040
4975
  };
4976
+ module2.exports.emphasisOrStrongStyleFor = function emphasisOrStrongStyleFor(markup) {
4977
+ switch (markup[0]) {
4978
+ case "*":
4979
+ return "asterisk";
4980
+ default:
4981
+ return "underscore";
4982
+ }
4983
+ };
5041
4984
  function indentFor(token) {
5042
4985
  const line = token.line.replace(/^[\s>]*(> |>)/, "");
5043
4986
  return line.length - line.trimStart().length;
@@ -5071,8 +5014,9 @@ var require_helpers2 = __commonJS({
5071
5014
  }
5072
5015
  module2.exports.filterTokens = filterTokens;
5073
5016
  function isMathBlock(token) {
5074
- return token.tag === "math" && token.type.startsWith("math_block") && !token.type.endsWith("_end");
5017
+ return (token.tag === "$$" || token.tag === "math") && token.type.startsWith("math_block") && !token.type.endsWith("_end");
5075
5018
  }
5019
+ module2.exports.isMathBlock = isMathBlock;
5076
5020
  module2.exports.getLineMetadata = function getLineMetadata(params) {
5077
5021
  const lineMetadata = params.lines.map((line, index) => [line, index, false, 0, false, false, false, false]);
5078
5022
  filterTokens(params, "fence", (token) => {
@@ -5109,11 +5053,12 @@ var require_helpers2 = __commonJS({
5109
5053
  });
5110
5054
  return lineMetadata;
5111
5055
  };
5112
- module2.exports.forEachLine = function forEachLine(lineMetadata, handler) {
5056
+ function forEachLine(lineMetadata, handler) {
5113
5057
  lineMetadata.forEach(function forMetadata(metadata) {
5114
5058
  handler(...metadata);
5115
5059
  });
5116
- };
5060
+ }
5061
+ module2.exports.forEachLine = forEachLine;
5117
5062
  module2.exports.flattenLists = function flattenLists(tokens) {
5118
5063
  const flattenedLists = [];
5119
5064
  const stack = [];
@@ -5122,9 +5067,6 @@ var require_helpers2 = __commonJS({
5122
5067
  const nestingStack = [];
5123
5068
  let lastWithMap = { "map": [0, 1] };
5124
5069
  tokens.forEach((token) => {
5125
- if (isMathBlock(token) && token.map[1]) {
5126
- token.map[1]++;
5127
- }
5128
5070
  if (token.type === "bullet_list_open" || token.type === "ordered_list_open") {
5129
5071
  stack.push(current);
5130
5072
  current = {
@@ -5262,13 +5204,26 @@ var require_helpers2 = __commonJS({
5262
5204
  }
5263
5205
  addError(onError, lineNumber, null, context, range, fixInfo);
5264
5206
  };
5265
- module2.exports.inlineCodeSpanRanges = (lines) => {
5207
+ module2.exports.codeBlockAndSpanRanges = (params, lineMetadata) => {
5266
5208
  const exclusions = [];
5267
- forEachInlineCodeSpan(lines.join("\n"), (code, lineIndex, columnIndex) => {
5268
- const codeLines = code.split(newLineRe);
5269
- for (let i = 0; i < codeLines.length; i++) {
5270
- exclusions.push([lineIndex + i, columnIndex, codeLines[i].length]);
5271
- columnIndex = 0;
5209
+ forEachLine(lineMetadata, (line, lineIndex, inCode, onFence) => {
5210
+ if (inCode && !onFence) {
5211
+ exclusions.push([lineIndex, 0, line.length]);
5212
+ }
5213
+ });
5214
+ filterTokens(params, "inline", (token) => {
5215
+ if (token.children.some((child) => child.type === "code_inline")) {
5216
+ const tokenLines = params.lines.slice(token.map[0], token.map[1]);
5217
+ forEachInlineCodeSpan(tokenLines.join("\n"), (code, lineIndex, columnIndex) => {
5218
+ const codeLines = code.split(newLineRe);
5219
+ for (const [i, line] of codeLines.entries()) {
5220
+ exclusions.push([
5221
+ token.lineNumber - 1 + lineIndex + i,
5222
+ i ? 0 : columnIndex,
5223
+ line.length
5224
+ ]);
5225
+ }
5226
+ });
5272
5227
  }
5273
5228
  });
5274
5229
  return exclusions;
@@ -5292,6 +5247,17 @@ var require_helpers2 = __commonJS({
5292
5247
  function emphasisMarkersInContent(params) {
5293
5248
  const { lines } = params;
5294
5249
  const byLine = new Array(lines.length);
5250
+ lines.forEach((tokenLine, tokenLineIndex) => {
5251
+ const inLine = [];
5252
+ let linkMatch = null;
5253
+ while (linkMatch = linkRe.exec(tokenLine)) {
5254
+ let markerMatch = null;
5255
+ while (markerMatch = emphasisMarkersRe.exec(linkMatch[0])) {
5256
+ inLine.push(linkMatch.index + markerMatch.index);
5257
+ }
5258
+ }
5259
+ byLine[tokenLineIndex] = inLine;
5260
+ });
5295
5261
  filterTokens(params, "inline", (token) => {
5296
5262
  const { children, lineNumber, map: map2 } = token;
5297
5263
  if (children.some((child) => child.type === "code_inline")) {
@@ -5299,33 +5265,22 @@ var require_helpers2 = __commonJS({
5299
5265
  forEachInlineCodeSpan(tokenLines.join("\n"), (code, lineIndex, column, tickCount) => {
5300
5266
  const codeLines = code.split(newLineRe);
5301
5267
  codeLines.forEach((codeLine, codeLineIndex) => {
5268
+ const byLineIndex = lineNumber - 1 + lineIndex + codeLineIndex;
5269
+ const inLine = byLine[byLineIndex];
5270
+ const codeLineOffset = codeLineIndex ? 0 : column - 1 + tickCount;
5302
5271
  let match = null;
5303
5272
  while (match = emphasisMarkersRe.exec(codeLine)) {
5304
- const byLineIndex = lineNumber - 1 + lineIndex + codeLineIndex;
5305
- const inLine = byLine[byLineIndex] || [];
5306
- const codeLineOffset = codeLineIndex ? 0 : column - 1 + tickCount;
5307
5273
  inLine.push(codeLineOffset + match.index);
5308
- byLine[byLineIndex] = inLine;
5309
5274
  }
5275
+ byLine[byLineIndex] = inLine;
5310
5276
  });
5311
5277
  });
5312
5278
  }
5313
5279
  });
5314
- lines.forEach((tokenLine, tokenLineIndex) => {
5315
- let linkMatch = null;
5316
- while (linkMatch = linkRe.exec(tokenLine)) {
5317
- let markerMatch = null;
5318
- while (markerMatch = emphasisMarkersRe.exec(linkMatch[0])) {
5319
- const inLine = byLine[tokenLineIndex] || [];
5320
- inLine.push(linkMatch.index + markerMatch.index);
5321
- byLine[tokenLineIndex] = inLine;
5322
- }
5323
- }
5324
- });
5325
5280
  return byLine;
5326
5281
  }
5327
5282
  module2.exports.emphasisMarkersInContent = emphasisMarkersInContent;
5328
- function getPreferredLineEnding(input) {
5283
+ function getPreferredLineEnding(input, platform) {
5329
5284
  let cr = 0;
5330
5285
  let lf = 0;
5331
5286
  let crlf = 0;
@@ -5345,7 +5300,7 @@ var require_helpers2 = __commonJS({
5345
5300
  });
5346
5301
  let preferredLineEnding = null;
5347
5302
  if (!cr && !lf && !crlf) {
5348
- preferredLineEnding = os.EOL;
5303
+ preferredLineEnding = (platform || process.platform) === "win32" ? "\r\n" : "\n";
5349
5304
  } else if (lf >= crlf && lf >= cr) {
5350
5305
  preferredLineEnding = "\n";
5351
5306
  } else if (crlf >= cr) {
@@ -5408,6 +5363,50 @@ var require_helpers2 = __commonJS({
5408
5363
  });
5409
5364
  return lines.filter((line) => line !== null).join(lineEnding);
5410
5365
  };
5366
+ function getRangeAndFixInfoIfFound(lines, lineIndex, search, replace) {
5367
+ let range = null;
5368
+ let fixInfo = null;
5369
+ const searchIndex = lines[lineIndex].indexOf(search);
5370
+ if (searchIndex !== -1) {
5371
+ const column = searchIndex + 1;
5372
+ const length = search.length;
5373
+ range = [column, length];
5374
+ fixInfo = {
5375
+ "editColumn": column,
5376
+ "deleteCount": length,
5377
+ "insertText": replace
5378
+ };
5379
+ }
5380
+ return {
5381
+ range,
5382
+ fixInfo
5383
+ };
5384
+ }
5385
+ module2.exports.getRangeAndFixInfoIfFound = getRangeAndFixInfoIfFound;
5386
+ function getNextChildToken(parentToken, childToken, nextType, nextNextType) {
5387
+ const { children } = parentToken;
5388
+ const index = children.indexOf(childToken);
5389
+ if (index !== -1 && children.length > index + 2 && children[index + 1].type === nextType && children[index + 2].type === nextNextType) {
5390
+ return children[index + 1];
5391
+ }
5392
+ return null;
5393
+ }
5394
+ module2.exports.getNextChildToken = getNextChildToken;
5395
+ function deepFreeze(obj) {
5396
+ const pending = [obj];
5397
+ let current = null;
5398
+ while (current = pending.shift()) {
5399
+ Object.freeze(current);
5400
+ for (const name of Object.getOwnPropertyNames(current)) {
5401
+ const value = current[name];
5402
+ if (value && typeof value === "object") {
5403
+ pending.push(value);
5404
+ }
5405
+ }
5406
+ }
5407
+ return obj;
5408
+ }
5409
+ module2.exports.deepFreeze = deepFreeze;
5411
5410
  }
5412
5411
  });
5413
5412
 
@@ -5498,6 +5497,13 @@ var require_md003 = __commonJS({
5498
5497
  var require_cache = __commonJS({
5499
5498
  "node_modules/markdownlint/lib/cache.js"(exports, module2) {
5500
5499
  "use strict";
5500
+ var codeBlockAndSpanRanges = null;
5501
+ module2.exports.codeBlockAndSpanRanges = (value) => {
5502
+ if (value) {
5503
+ codeBlockAndSpanRanges = value;
5504
+ }
5505
+ return codeBlockAndSpanRanges;
5506
+ };
5501
5507
  var flattenedLists = null;
5502
5508
  module2.exports.flattenedLists = (value) => {
5503
5509
  if (value) {
@@ -5505,13 +5511,6 @@ var require_cache = __commonJS({
5505
5511
  }
5506
5512
  return flattenedLists;
5507
5513
  };
5508
- var inlineCodeSpanRanges = null;
5509
- module2.exports.inlineCodeSpanRanges = (value) => {
5510
- if (value) {
5511
- inlineCodeSpanRanges = value;
5512
- }
5513
- return inlineCodeSpanRanges;
5514
- };
5515
5514
  var lineMetadata = null;
5516
5515
  module2.exports.lineMetadata = (value) => {
5517
5516
  if (value) {
@@ -5520,8 +5519,8 @@ var require_cache = __commonJS({
5520
5519
  return lineMetadata;
5521
5520
  };
5522
5521
  module2.exports.clear = () => {
5522
+ codeBlockAndSpanRanges = null;
5523
5523
  flattenedLists = null;
5524
- inlineCodeSpanRanges = null;
5525
5524
  lineMetadata = null;
5526
5525
  };
5527
5526
  }
@@ -5685,12 +5684,12 @@ var require_md007 = __commonJS({
5685
5684
  "function": function MD007(params, onError) {
5686
5685
  const indent = Number(params.config.indent || 2);
5687
5686
  const startIndented = !!params.config.start_indented;
5687
+ const startIndent = Number(params.config.start_indent || indent);
5688
5688
  flattenedLists().forEach((list) => {
5689
5689
  if (list.unordered && list.parentsUnordered) {
5690
5690
  list.items.forEach((item) => {
5691
5691
  const { lineNumber, line } = item;
5692
- const expectedNesting = list.nesting + (startIndented ? 1 : 0);
5693
- const expectedIndent = expectedNesting * indent;
5692
+ const expectedIndent = (startIndented ? startIndent : 0) + list.nesting * indent;
5694
5693
  const actualIndent = indentFor(item);
5695
5694
  let range = null;
5696
5695
  let editColumn = 1;
@@ -5787,8 +5786,8 @@ var require_md009 = __commonJS({
5787
5786
  var require_md010 = __commonJS({
5788
5787
  "node_modules/markdownlint/lib/md010.js"(exports, module2) {
5789
5788
  "use strict";
5790
- var { addError, forEachLine } = require_helpers2();
5791
- var { lineMetadata } = require_cache();
5789
+ var { addError, forEachLine, overlapsAnyRange } = require_helpers2();
5790
+ var { codeBlockAndSpanRanges, lineMetadata } = require_cache();
5792
5791
  var tabRe = /\t+/g;
5793
5792
  module2.exports = {
5794
5793
  "names": ["MD010", "no-hard-tabs"],
@@ -5796,20 +5795,24 @@ var require_md010 = __commonJS({
5796
5795
  "tags": ["whitespace", "hard_tab"],
5797
5796
  "function": function MD010(params, onError) {
5798
5797
  const codeBlocks = params.config.code_blocks;
5799
- const includeCodeBlocks = codeBlocks === void 0 ? true : !!codeBlocks;
5798
+ const includeCode = codeBlocks === void 0 ? true : !!codeBlocks;
5800
5799
  const spacesPerTab = params.config.spaces_per_tab;
5801
5800
  const spaceMultiplier = spacesPerTab === void 0 ? 1 : Math.max(0, Number(spacesPerTab));
5801
+ const exclusions = includeCode ? [] : codeBlockAndSpanRanges();
5802
5802
  forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
5803
- if (!inCode || includeCodeBlocks) {
5803
+ if (includeCode || !inCode) {
5804
5804
  let match = null;
5805
5805
  while ((match = tabRe.exec(line)) !== null) {
5806
- const column = match.index + 1;
5806
+ const { index } = match;
5807
+ const column = index + 1;
5807
5808
  const length = match[0].length;
5808
- addError(onError, lineIndex + 1, "Column: " + column, null, [column, length], {
5809
- "editColumn": column,
5810
- "deleteCount": length,
5811
- "insertText": "".padEnd(length * spaceMultiplier)
5812
- });
5809
+ if (!overlapsAnyRange(exclusions, lineIndex, index, length)) {
5810
+ addError(onError, lineIndex + 1, "Column: " + column, null, [column, length], {
5811
+ "editColumn": column,
5812
+ "deleteCount": length,
5813
+ "insertText": "".padEnd(length * spaceMultiplier)
5814
+ });
5815
+ }
5813
5816
  }
5814
5817
  }
5815
5818
  });
@@ -5823,14 +5826,14 @@ var require_md011 = __commonJS({
5823
5826
  "node_modules/markdownlint/lib/md011.js"(exports, module2) {
5824
5827
  "use strict";
5825
5828
  var { addError, forEachLine, overlapsAnyRange } = require_helpers2();
5826
- var { inlineCodeSpanRanges, lineMetadata } = require_cache();
5829
+ var { codeBlockAndSpanRanges, lineMetadata } = require_cache();
5827
5830
  var reversedLinkRe = /(^|[^\\])\(([^)]+)\)\[([^\]^][^\]]*)](?!\()/g;
5828
5831
  module2.exports = {
5829
5832
  "names": ["MD011", "no-reversed-links"],
5830
5833
  "description": "Reversed link syntax",
5831
5834
  "tags": ["links"],
5832
5835
  "function": function MD011(params, onError) {
5833
- const exclusions = inlineCodeSpanRanges();
5836
+ const exclusions = codeBlockAndSpanRanges();
5834
5837
  forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence) => {
5835
5838
  if (!inCode && !onFence) {
5836
5839
  let match = null;
@@ -6597,11 +6600,15 @@ var require_md032 = __commonJS({
6597
6600
  var require_md033 = __commonJS({
6598
6601
  "node_modules/markdownlint/lib/md033.js"(exports, module2) {
6599
6602
  "use strict";
6600
- var { addError, forEachLine, unescapeMarkdown } = require_helpers2();
6601
- var { lineMetadata } = require_cache();
6603
+ var {
6604
+ addError,
6605
+ forEachLine,
6606
+ overlapsAnyRange,
6607
+ unescapeMarkdown
6608
+ } = require_helpers2();
6609
+ var { codeBlockAndSpanRanges, lineMetadata } = require_cache();
6602
6610
  var htmlElementRe = /<(([A-Za-z][A-Za-z0-9-]*)(?:\s[^>]*)?)\/?>/g;
6603
6611
  var linkDestinationRe = /]\(\s*$/;
6604
- var inlineCodeRe = /^[^`]*(`+[^`]+`+[^`]+)*`+[^`]*$/;
6605
6612
  var emailAddressRe = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
6606
6613
  module2.exports = {
6607
6614
  "names": ["MD033", "no-inline-html"],
@@ -6611,15 +6618,16 @@ var require_md033 = __commonJS({
6611
6618
  let allowedElements = params.config.allowed_elements;
6612
6619
  allowedElements = Array.isArray(allowedElements) ? allowedElements : [];
6613
6620
  allowedElements = allowedElements.map((element) => element.toLowerCase());
6621
+ const exclusions = codeBlockAndSpanRanges();
6614
6622
  forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
6615
6623
  let match = null;
6616
6624
  while (!inCode && (match = htmlElementRe.exec(line)) !== null) {
6617
6625
  const [tag, content, element] = match;
6618
- if (!allowedElements.includes(element.toLowerCase()) && !tag.endsWith("\\>") && !emailAddressRe.test(content)) {
6626
+ if (!allowedElements.includes(element.toLowerCase()) && !tag.endsWith("\\>") && !emailAddressRe.test(content) && !overlapsAnyRange(exclusions, lineIndex, match.index, match[0].length)) {
6619
6627
  const prefix = line.substring(0, match.index);
6620
- if (!linkDestinationRe.test(prefix) && !inlineCodeRe.test(prefix)) {
6628
+ if (!linkDestinationRe.test(prefix)) {
6621
6629
  const unescaped = unescapeMarkdown(prefix + "<", "_");
6622
- if (!unescaped.endsWith("_") && (unescaped + "`").match(/`/g).length % 2) {
6630
+ if (!unescaped.endsWith("_")) {
6623
6631
  addError(onError, lineIndex + 1, "Element: " + element, null, [match.index + 1, tag.length]);
6624
6632
  }
6625
6633
  }
@@ -6690,12 +6698,12 @@ var require_md035 = __commonJS({
6690
6698
  "tags": ["hr"],
6691
6699
  "function": function MD035(params, onError) {
6692
6700
  let style = String(params.config.style || "consistent");
6693
- filterTokens(params, "hr", function forToken(token) {
6694
- const lineTrim = token.line.trim();
6701
+ filterTokens(params, "hr", (token) => {
6702
+ const { lineNumber, markup } = token;
6695
6703
  if (style === "consistent") {
6696
- style = lineTrim;
6704
+ style = markup;
6697
6705
  }
6698
- addErrorDetailIf(onError, token.lineNumber, style, lineTrim);
6706
+ addErrorDetailIf(onError, lineNumber, style, markup);
6699
6707
  });
6700
6708
  }
6701
6709
  };
@@ -6759,6 +6767,7 @@ var require_md037 = __commonJS({
6759
6767
  var { addErrorContext, emphasisMarkersInContent, forEachLine, isBlankLine } = require_helpers2();
6760
6768
  var { lineMetadata } = require_cache();
6761
6769
  var emphasisRe = /(^|[^\\]|\\\\)(?:(\*\*?\*?)|(__?_?))/g;
6770
+ var embeddedUnderscoreRe = /([A-Za-z0-9])_([A-Za-z0-9])/g;
6762
6771
  var asteriskListItemMarkerRe = /^([\s>]*)\*(\s+)/;
6763
6772
  var leftSpaceRe = /^\s+/;
6764
6773
  var rightSpaceRe = /\s+$/;
@@ -6821,12 +6830,13 @@ var require_md037 = __commonJS({
6821
6830
  if (inCode || onFence || onBreak || inMath) {
6822
6831
  return;
6823
6832
  }
6833
+ let patchedLine = line.replace(embeddedUnderscoreRe, "$1 $2");
6824
6834
  if (onItemStart) {
6825
- line = line.replace(asteriskListItemMarkerRe, "$1 $2");
6835
+ patchedLine = patchedLine.replace(asteriskListItemMarkerRe, "$1 $2");
6826
6836
  }
6827
6837
  let match = null;
6828
- while (match = emphasisRe.exec(line)) {
6829
- const ignoreMarkersForLine = ignoreMarkersByLine[lineIndex] || [];
6838
+ while (match = emphasisRe.exec(patchedLine)) {
6839
+ const ignoreMarkersForLine = ignoreMarkersByLine[lineIndex];
6830
6840
  const matchIndex = match.index + match[1].length;
6831
6841
  if (ignoreMarkersForLine.includes(matchIndex)) {
6832
6842
  continue;
@@ -6933,7 +6943,7 @@ var require_md039 = __commonJS({
6933
6943
  "node_modules/markdownlint/lib/md039.js"(exports, module2) {
6934
6944
  "use strict";
6935
6945
  var { addErrorContext, filterTokens } = require_helpers2();
6936
- var spaceInLinkRe = /\[(?:\s+(?:[^\]]*?)\s*|(?:[^\]]*?)\s+)](?=\(\S*\))/;
6946
+ var spaceInLinkRe = /\[(?:\s+(?:[^\]]*?)\s*|(?:[^\]]*?)\s+)](?=((?:\([^)]*\))|(?:\[[^\]]*\])))/;
6937
6947
  module2.exports = {
6938
6948
  "names": ["MD039", "no-space-in-links"],
6939
6949
  "description": "Spaces inside link text",
@@ -7149,7 +7159,7 @@ var require_md044 = __commonJS({
7149
7159
  linkRe,
7150
7160
  linkReferenceRe
7151
7161
  } = require_helpers2();
7152
- var { inlineCodeSpanRanges, lineMetadata } = require_cache();
7162
+ var { codeBlockAndSpanRanges, lineMetadata } = require_cache();
7153
7163
  module2.exports = {
7154
7164
  "names": ["MD044", "proper-names"],
7155
7165
  "description": "Proper names should have the correct capitalization",
@@ -7178,7 +7188,7 @@ var require_md044 = __commonJS({
7178
7188
  }
7179
7189
  });
7180
7190
  if (!includeCodeBlocks) {
7181
- exclusions.push(...inlineCodeSpanRanges());
7191
+ exclusions.push(...codeBlockAndSpanRanges());
7182
7192
  }
7183
7193
  for (const name of names) {
7184
7194
  const escapedName = escapeForRegExp(name);
@@ -7304,14 +7314,94 @@ var require_md048 = __commonJS({
7304
7314
  }
7305
7315
  });
7306
7316
 
7317
+ // node_modules/markdownlint/lib/md049.js
7318
+ var require_md049 = __commonJS({
7319
+ "node_modules/markdownlint/lib/md049.js"(exports, module2) {
7320
+ "use strict";
7321
+ var {
7322
+ addError,
7323
+ emphasisOrStrongStyleFor,
7324
+ forEachInlineChild,
7325
+ getNextChildToken,
7326
+ getRangeAndFixInfoIfFound
7327
+ } = require_helpers2();
7328
+ module2.exports = {
7329
+ "names": ["MD049", "emphasis-style"],
7330
+ "description": "Emphasis style should be consistent",
7331
+ "tags": ["emphasis"],
7332
+ "function": function MD049(params, onError) {
7333
+ let expectedStyle = String(params.config.style || "consistent");
7334
+ forEachInlineChild(params, "em_open", (token, parent) => {
7335
+ const { lineNumber, markup } = token;
7336
+ const markupStyle = emphasisOrStrongStyleFor(markup);
7337
+ if (expectedStyle === "consistent") {
7338
+ expectedStyle = markupStyle;
7339
+ }
7340
+ if (expectedStyle !== markupStyle) {
7341
+ let rangeAndFixInfo = {};
7342
+ const contentToken = getNextChildToken(parent, token, "text", "em_close");
7343
+ if (contentToken) {
7344
+ const { content } = contentToken;
7345
+ const actual = `${markup}${content}${markup}`;
7346
+ const expectedMarkup = expectedStyle === "asterisk" ? "*" : "_";
7347
+ const expected = `${expectedMarkup}${content}${expectedMarkup}`;
7348
+ rangeAndFixInfo = getRangeAndFixInfoIfFound(params.lines, lineNumber - 1, actual, expected);
7349
+ }
7350
+ addError(onError, lineNumber, `Expected: ${expectedStyle}; Actual: ${markupStyle}`, null, rangeAndFixInfo.range, rangeAndFixInfo.fixInfo);
7351
+ }
7352
+ });
7353
+ }
7354
+ };
7355
+ }
7356
+ });
7357
+
7358
+ // node_modules/markdownlint/lib/md050.js
7359
+ var require_md050 = __commonJS({
7360
+ "node_modules/markdownlint/lib/md050.js"(exports, module2) {
7361
+ "use strict";
7362
+ var {
7363
+ addError,
7364
+ emphasisOrStrongStyleFor,
7365
+ forEachInlineChild,
7366
+ getNextChildToken,
7367
+ getRangeAndFixInfoIfFound
7368
+ } = require_helpers2();
7369
+ module2.exports = {
7370
+ "names": ["MD050", "strong-style"],
7371
+ "description": "Strong style should be consistent",
7372
+ "tags": ["emphasis"],
7373
+ "function": function MD050(params, onError) {
7374
+ let expectedStyle = String(params.config.style || "consistent");
7375
+ forEachInlineChild(params, "strong_open", (token, parent) => {
7376
+ const { lineNumber, markup } = token;
7377
+ const markupStyle = emphasisOrStrongStyleFor(markup);
7378
+ if (expectedStyle === "consistent") {
7379
+ expectedStyle = markupStyle;
7380
+ }
7381
+ if (expectedStyle !== markupStyle) {
7382
+ let rangeAndFixInfo = {};
7383
+ const contentToken = getNextChildToken(parent, token, "text", "strong_close");
7384
+ if (contentToken) {
7385
+ const { content } = contentToken;
7386
+ const actual = `${markup}${content}${markup}`;
7387
+ const expectedMarkup = expectedStyle === "asterisk" ? "**" : "__";
7388
+ const expected = `${expectedMarkup}${content}${expectedMarkup}`;
7389
+ rangeAndFixInfo = getRangeAndFixInfoIfFound(params.lines, lineNumber - 1, actual, expected);
7390
+ }
7391
+ addError(onError, lineNumber, `Expected: ${expectedStyle}; Actual: ${markupStyle}`, null, rangeAndFixInfo.range, rangeAndFixInfo.fixInfo);
7392
+ }
7393
+ });
7394
+ }
7395
+ };
7396
+ }
7397
+ });
7398
+
7307
7399
  // node_modules/markdownlint/lib/rules.js
7308
7400
  var require_rules = __commonJS({
7309
7401
  "node_modules/markdownlint/lib/rules.js"(exports, module2) {
7310
7402
  "use strict";
7311
7403
  var URL2 = require("url").URL;
7312
- var packageJson = require_package();
7313
- var homepage = packageJson.homepage;
7314
- var version = packageJson.version;
7404
+ var { homepage, version } = require_constants();
7315
7405
  var rules = [
7316
7406
  require_md001(),
7317
7407
  require_md002(),
@@ -7356,7 +7446,9 @@ var require_rules = __commonJS({
7356
7446
  require_md045(),
7357
7447
  require_md046(),
7358
7448
  require_md047(),
7359
- require_md048()
7449
+ require_md048(),
7450
+ require_md049(),
7451
+ require_md050()
7360
7452
  ];
7361
7453
  rules.forEach((rule) => {
7362
7454
  const name = rule.names[0].toLowerCase();
@@ -7373,12 +7465,12 @@ var require_markdownlint = __commonJS({
7373
7465
  var path2 = require("path");
7374
7466
  var { promisify } = require("util");
7375
7467
  var markdownIt = require_markdown_it();
7468
+ var { deprecatedRuleNames } = require_constants();
7376
7469
  var rules = require_rules();
7377
7470
  var helpers = require_helpers2();
7378
7471
  var cache = require_cache();
7379
7472
  var dynamicRequire = typeof __non_webpack_require__ === "undefined" ? require : __non_webpack_require__;
7380
- var deprecatedRuleNames = ["MD002", "MD006"];
7381
- function validateRuleList(ruleList) {
7473
+ function validateRuleList(ruleList, synchronous) {
7382
7474
  let result = null;
7383
7475
  if (ruleList.length === rules.length) {
7384
7476
  return result;
@@ -7408,6 +7500,12 @@ var require_markdownlint = __commonJS({
7408
7500
  if (!result && rule.information && Object.getPrototypeOf(rule.information) !== URL.prototype) {
7409
7501
  result = newError("information");
7410
7502
  }
7503
+ if (!result && rule.asynchronous !== void 0 && typeof rule.asynchronous !== "boolean") {
7504
+ result = newError("asynchronous");
7505
+ }
7506
+ if (!result && rule.asynchronous && synchronous) {
7507
+ result = new Error("Custom rule " + rule.names.join("/") + " at index " + customIndex + " is asynchronous and can not be used in a synchronous context.");
7508
+ }
7411
7509
  if (!result) {
7412
7510
  rule.names.forEach(function forName(name) {
7413
7511
  const nameUpper = name.toUpperCase();
@@ -7484,17 +7582,18 @@ var require_markdownlint = __commonJS({
7484
7582
  };
7485
7583
  }
7486
7584
  function annotateTokens(tokens, lines) {
7487
- let tableMap = null;
7585
+ let trMap = null;
7488
7586
  tokens.forEach(function forToken(token) {
7489
- if (token.type === "thead_open" || token.type === "tbody_open") {
7490
- tableMap = [...token.map];
7491
- } else if (token.type === "tr_close" && tableMap) {
7492
- tableMap[0]++;
7493
- } else if (token.type === "thead_close" || token.type === "tbody_close") {
7494
- tableMap = null;
7587
+ if (token.type === "tr_open") {
7588
+ trMap = token.map;
7589
+ } else if (token.type === "tr_close") {
7590
+ trMap = null;
7591
+ }
7592
+ if (!token.map && trMap) {
7593
+ token.map = [...trMap];
7495
7594
  }
7496
- if (tableMap && !token.map) {
7497
- token.map = [...tableMap];
7595
+ if (helpers.isMathBlock(token) && token.map[1]) {
7596
+ token.map[1]++;
7498
7597
  }
7499
7598
  if (token.map) {
7500
7599
  token.line = lines[token.map[0]];
@@ -7568,8 +7667,7 @@ var require_markdownlint = __commonJS({
7568
7667
  let capturedRules = {};
7569
7668
  const allRuleNames = [];
7570
7669
  const enabledRulesPerLineNumber = new Array(1 + frontMatterLines.length);
7571
- function handleInlineConfig(perLine, forEachMatch, forEachLine) {
7572
- const input = perLine ? lines : [lines.join("\n")];
7670
+ function handleInlineConfig(input, forEachMatch, forEachLine) {
7573
7671
  input.forEach((line, lineIndex) => {
7574
7672
  if (!noInlineConfig) {
7575
7673
  let match = null;
@@ -7594,6 +7692,7 @@ var require_markdownlint = __commonJS({
7594
7692
  }
7595
7693
  }
7596
7694
  function applyEnableDisable(action, parameter, state) {
7695
+ state = __spreadValues({}, state);
7597
7696
  const enabled = action.startsWith("ENABLE");
7598
7697
  const items = parameter ? parameter.trim().toUpperCase().split(/\s+/) : allRuleNames;
7599
7698
  items.forEach((nameUpper) => {
@@ -7601,31 +7700,32 @@ var require_markdownlint = __commonJS({
7601
7700
  state[ruleName] = enabled;
7602
7701
  });
7603
7702
  });
7703
+ return state;
7604
7704
  }
7605
7705
  function enableDisableFile(action, parameter) {
7606
7706
  if (action === "ENABLE-FILE" || action === "DISABLE-FILE") {
7607
- applyEnableDisable(action, parameter, enabledRules);
7707
+ enabledRules = applyEnableDisable(action, parameter, enabledRules);
7608
7708
  }
7609
7709
  }
7610
7710
  function captureRestoreEnableDisable(action, parameter) {
7611
7711
  if (action === "CAPTURE") {
7612
- capturedRules = __spreadValues({}, enabledRules);
7712
+ capturedRules = enabledRules;
7613
7713
  } else if (action === "RESTORE") {
7614
- enabledRules = __spreadValues({}, capturedRules);
7714
+ enabledRules = capturedRules;
7615
7715
  } else if (action === "ENABLE" || action === "DISABLE") {
7616
- enabledRules = __spreadValues({}, enabledRules);
7617
- applyEnableDisable(action, parameter, enabledRules);
7716
+ enabledRules = applyEnableDisable(action, parameter, enabledRules);
7618
7717
  }
7619
7718
  }
7620
7719
  function updateLineState() {
7621
- enabledRulesPerLineNumber.push(__spreadValues({}, enabledRules));
7720
+ enabledRulesPerLineNumber.push(enabledRules);
7622
7721
  }
7623
7722
  function disableNextLine(action, parameter, lineNumber) {
7624
7723
  if (action === "DISABLE-NEXT-LINE") {
7625
- applyEnableDisable(action, parameter, enabledRulesPerLineNumber[lineNumber + 1] || {});
7724
+ const nextLineNumber = frontMatterLines.length + lineNumber + 1;
7725
+ enabledRulesPerLineNumber[nextLineNumber] = applyEnableDisable(action, parameter, enabledRulesPerLineNumber[nextLineNumber] || {});
7626
7726
  }
7627
7727
  }
7628
- handleInlineConfig(false, configureFile);
7728
+ handleInlineConfig([lines.join("\n")], configureFile);
7629
7729
  const effectiveConfig = getEffectiveConfig(ruleList, config2, aliasToRuleNames);
7630
7730
  ruleList.forEach((rule) => {
7631
7731
  const ruleName = rule.names[0].toUpperCase();
@@ -7633,23 +7733,14 @@ var require_markdownlint = __commonJS({
7633
7733
  enabledRules[ruleName] = !!effectiveConfig[ruleName];
7634
7734
  });
7635
7735
  capturedRules = enabledRules;
7636
- handleInlineConfig(true, enableDisableFile);
7637
- handleInlineConfig(true, captureRestoreEnableDisable, updateLineState);
7638
- handleInlineConfig(true, disableNextLine);
7736
+ handleInlineConfig(lines, enableDisableFile);
7737
+ handleInlineConfig(lines, captureRestoreEnableDisable, updateLineState);
7738
+ handleInlineConfig(lines, disableNextLine);
7639
7739
  return {
7640
7740
  effectiveConfig,
7641
7741
  enabledRulesPerLineNumber
7642
7742
  };
7643
7743
  }
7644
- function lineNumberComparison(a, b) {
7645
- return a.lineNumber - b.lineNumber;
7646
- }
7647
- function filterAllValues() {
7648
- return true;
7649
- }
7650
- function uniqueFilterForSortedErrors(value, index, array) {
7651
- return index === 0 || value.lineNumber > array[index - 1].lineNumber;
7652
- }
7653
7744
  function lintContent(ruleList, name, content, md, config2, frontMatter, handleRuleFailures, noInlineConfig, resultVersion, callback) {
7654
7745
  content = content.replace(/^\uFEFF/, "");
7655
7746
  const removeFrontMatterResult = removeFrontMatter(content, frontMatter);
@@ -7661,27 +7752,29 @@ var require_markdownlint = __commonJS({
7661
7752
  const aliasToRuleNames = mapAliasToRuleNames(ruleList);
7662
7753
  const { effectiveConfig, enabledRulesPerLineNumber } = getEnabledRulesPerLineNumber(ruleList, lines, frontMatterLines, noInlineConfig, config2, aliasToRuleNames);
7663
7754
  const params = {
7664
- name,
7665
- tokens,
7666
- lines,
7667
- frontMatterLines
7755
+ "name": helpers.deepFreeze(name),
7756
+ "tokens": helpers.deepFreeze(tokens),
7757
+ "lines": helpers.deepFreeze(lines),
7758
+ "frontMatterLines": helpers.deepFreeze(frontMatterLines)
7668
7759
  };
7669
7760
  cache.lineMetadata(helpers.getLineMetadata(params));
7670
7761
  cache.flattenedLists(helpers.flattenLists(params.tokens));
7671
- cache.inlineCodeSpanRanges(helpers.inlineCodeSpanRanges(params.lines));
7672
- const result = resultVersion === 0 ? {} : [];
7762
+ cache.codeBlockAndSpanRanges(helpers.codeBlockAndSpanRanges(params, cache.lineMetadata()));
7763
+ let results = [];
7673
7764
  function forRule(rule) {
7674
- const ruleNameFriendly = rule.names[0];
7675
- const ruleName = ruleNameFriendly.toUpperCase();
7765
+ const ruleName = rule.names[0].toUpperCase();
7676
7766
  params.config = effectiveConfig[ruleName];
7677
7767
  function throwError2(property) {
7678
7768
  throw new Error("Property '" + property + "' of onError parameter is incorrect.");
7679
7769
  }
7680
- const errors = [];
7681
7770
  function onError(errorInfo) {
7682
7771
  if (!errorInfo || !helpers.isNumber(errorInfo.lineNumber) || errorInfo.lineNumber < 1 || errorInfo.lineNumber > lines.length) {
7683
7772
  throwError2("lineNumber");
7684
7773
  }
7774
+ const lineNumber = errorInfo.lineNumber + frontMatterLines.length;
7775
+ if (!enabledRulesPerLineNumber[lineNumber][ruleName]) {
7776
+ return;
7777
+ }
7685
7778
  if (errorInfo.detail && !helpers.isString(errorInfo.detail)) {
7686
7779
  throwError2("detail");
7687
7780
  }
@@ -7723,69 +7816,91 @@ var require_markdownlint = __commonJS({
7723
7816
  cleanFixInfo.insertText = fixInfo.insertText;
7724
7817
  }
7725
7818
  }
7726
- errors.push({
7727
- "lineNumber": errorInfo.lineNumber + frontMatterLines.length,
7728
- "detail": errorInfo.detail || null,
7729
- "context": errorInfo.context || null,
7730
- "range": errorInfo.range ? [...errorInfo.range] : null,
7819
+ results.push({
7820
+ lineNumber,
7821
+ "ruleName": rule.names[0],
7822
+ "ruleNames": rule.names,
7823
+ "ruleDescription": rule.description,
7824
+ "ruleInformation": rule.information ? rule.information.href : null,
7825
+ "errorDetail": errorInfo.detail || null,
7826
+ "errorContext": errorInfo.context || null,
7827
+ "errorRange": errorInfo.range ? [...errorInfo.range] : null,
7731
7828
  "fixInfo": fixInfo ? cleanFixInfo : null
7732
7829
  });
7733
7830
  }
7734
- if (handleRuleFailures) {
7735
- try {
7736
- rule.function(params, onError);
7737
- } catch (error) {
7738
- onError({
7739
- "lineNumber": 1,
7740
- "detail": `This rule threw an exception: ${error.message}`
7741
- });
7831
+ const catchCallsOnError = (error) => onError({
7832
+ "lineNumber": 1,
7833
+ "detail": `This rule threw an exception: ${error.message || error}`
7834
+ });
7835
+ const invokeRuleFunction = () => rule.function(params, onError);
7836
+ if (rule.asynchronous) {
7837
+ const ruleFunctionPromise = Promise.resolve().then(invokeRuleFunction);
7838
+ return handleRuleFailures ? ruleFunctionPromise.catch(catchCallsOnError) : ruleFunctionPromise;
7839
+ }
7840
+ try {
7841
+ invokeRuleFunction();
7842
+ } catch (error) {
7843
+ if (handleRuleFailures) {
7844
+ catchCallsOnError(error);
7845
+ } else {
7846
+ throw error;
7742
7847
  }
7743
- } else {
7744
- rule.function(params, onError);
7745
- }
7746
- if (errors.length > 0) {
7747
- errors.sort(lineNumberComparison);
7748
- const filteredErrors = errors.filter(resultVersion === 3 ? filterAllValues : uniqueFilterForSortedErrors).filter(function removeDisabledRules(error) {
7749
- return enabledRulesPerLineNumber[error.lineNumber][ruleName];
7750
- }).map(function formatResults(error) {
7751
- if (resultVersion === 0) {
7752
- return error.lineNumber;
7753
- }
7754
- const errorObject = {};
7755
- errorObject.lineNumber = error.lineNumber;
7756
- if (resultVersion === 1) {
7757
- errorObject.ruleName = ruleNameFriendly;
7758
- errorObject.ruleAlias = rule.names[1] || rule.names[0];
7759
- } else {
7760
- errorObject.ruleNames = rule.names;
7761
- }
7762
- errorObject.ruleDescription = rule.description;
7763
- errorObject.ruleInformation = rule.information ? rule.information.href : null;
7764
- errorObject.errorDetail = error.detail;
7765
- errorObject.errorContext = error.context;
7766
- errorObject.errorRange = error.range;
7767
- if (resultVersion === 3) {
7768
- errorObject.fixInfo = error.fixInfo;
7769
- }
7770
- return errorObject;
7848
+ }
7849
+ return null;
7850
+ }
7851
+ function formatResults() {
7852
+ results.sort((a, b) => a.ruleName.localeCompare(b.ruleName) || a.lineNumber - b.lineNumber);
7853
+ if (resultVersion < 3) {
7854
+ const noPrevious = {
7855
+ "ruleName": null,
7856
+ "lineNumber": -1
7857
+ };
7858
+ results = results.filter((error, index, array) => {
7859
+ delete error.fixInfo;
7860
+ const previous = array[index - 1] || noPrevious;
7861
+ return error.ruleName !== previous.ruleName || error.lineNumber !== previous.lineNumber;
7771
7862
  });
7772
- if (filteredErrors.length > 0) {
7773
- if (resultVersion === 0) {
7774
- result[ruleNameFriendly] = filteredErrors;
7775
- } else {
7776
- Array.prototype.push.apply(result, filteredErrors);
7777
- }
7863
+ }
7864
+ if (resultVersion === 0) {
7865
+ const dictionary = {};
7866
+ for (const error of results) {
7867
+ const ruleLines = dictionary[error.ruleName] || [];
7868
+ ruleLines.push(error.lineNumber);
7869
+ dictionary[error.ruleName] = ruleLines;
7870
+ }
7871
+ results = dictionary;
7872
+ } else if (resultVersion === 1) {
7873
+ for (const error of results) {
7874
+ error.ruleAlias = error.ruleNames[1] || error.ruleName;
7875
+ delete error.ruleNames;
7876
+ }
7877
+ } else {
7878
+ for (const error of results) {
7879
+ delete error.ruleName;
7778
7880
  }
7779
7881
  }
7882
+ return results;
7780
7883
  }
7884
+ const ruleListAsync = ruleList.filter((rule) => rule.asynchronous);
7885
+ const ruleListSync = ruleList.filter((rule) => !rule.asynchronous);
7886
+ const ruleListAsyncFirst = [
7887
+ ...ruleListAsync,
7888
+ ...ruleListSync
7889
+ ];
7890
+ const callbackSuccess = () => callback(null, formatResults());
7891
+ const callbackError = (error) => callback(error instanceof Error ? error : new Error(error));
7781
7892
  try {
7782
- ruleList.forEach(forRule);
7893
+ const ruleResults = ruleListAsyncFirst.map(forRule);
7894
+ if (ruleListAsync.length > 0) {
7895
+ Promise.all(ruleResults.slice(0, ruleListAsync.length)).then(callbackSuccess).catch(callbackError);
7896
+ } else {
7897
+ callbackSuccess();
7898
+ }
7783
7899
  } catch (error) {
7900
+ callbackError(error);
7901
+ } finally {
7784
7902
  cache.clear();
7785
- return callback(error);
7786
7903
  }
7787
- cache.clear();
7788
- return callback(null, result);
7789
7904
  }
7790
7905
  function lintFile(ruleList, file, md, config2, frontMatter, handleRuleFailures, noInlineConfig, resultVersion, fs2, synchronous, callback) {
7791
7906
  function lintContentWrapper(err, content) {
@@ -7805,7 +7920,7 @@ var require_markdownlint = __commonJS({
7805
7920
  callback = callback || function noop() {
7806
7921
  };
7807
7922
  const ruleList = rules.concat(options.customRules || []);
7808
- const ruleErr = validateRuleList(ruleList);
7923
+ const ruleErr = validateRuleList(ruleList, synchronous);
7809
7924
  if (ruleErr) {
7810
7925
  return callback(ruleErr);
7811
7926
  }
@@ -7830,54 +7945,50 @@ var require_markdownlint = __commonJS({
7830
7945
  const fs2 = options.fs || require("fs");
7831
7946
  const results = newResults(ruleList);
7832
7947
  let done = false;
7833
- let syncItem = null;
7834
- function syncCallback(err, result) {
7835
- if (err) {
7836
- done = true;
7837
- return callback(err);
7838
- }
7839
- results[syncItem] = result;
7840
- return null;
7841
- }
7842
- while (!done && (syncItem = stringsKeys.shift())) {
7843
- lintContent(ruleList, syncItem, strings[syncItem] || "", md, config2, frontMatter, handleRuleFailures, noInlineConfig, resultVersion, syncCallback);
7844
- }
7845
- if (synchronous) {
7846
- while (!done && (syncItem = files.shift())) {
7847
- lintFile(ruleList, syncItem, md, config2, frontMatter, handleRuleFailures, noInlineConfig, resultVersion, fs2, synchronous, syncCallback);
7848
- }
7849
- return done || callback(null, results);
7850
- }
7851
7948
  let concurrency = 0;
7852
- function lintConcurrently() {
7853
- const asyncItem = files.shift();
7949
+ function lintWorker() {
7950
+ let currentItem = null;
7951
+ function lintWorkerCallback(err, result) {
7952
+ concurrency--;
7953
+ if (err) {
7954
+ done = true;
7955
+ return callback(err);
7956
+ }
7957
+ results[currentItem] = result;
7958
+ if (!synchronous) {
7959
+ lintWorker();
7960
+ }
7961
+ return null;
7962
+ }
7854
7963
  if (done) {
7855
- } else if (asyncItem) {
7964
+ } else if (files.length > 0) {
7856
7965
  concurrency++;
7857
- lintFile(ruleList, asyncItem, md, config2, frontMatter, handleRuleFailures, noInlineConfig, resultVersion, fs2, synchronous, (err, result) => {
7858
- concurrency--;
7859
- if (err) {
7860
- done = true;
7861
- return callback(err);
7862
- }
7863
- results[asyncItem] = result;
7864
- lintConcurrently();
7865
- return null;
7866
- });
7966
+ currentItem = files.shift();
7967
+ lintFile(ruleList, currentItem, md, config2, frontMatter, handleRuleFailures, noInlineConfig, resultVersion, fs2, synchronous, lintWorkerCallback);
7968
+ } else if (stringsKeys.length > 0) {
7969
+ concurrency++;
7970
+ currentItem = stringsKeys.shift();
7971
+ lintContent(ruleList, currentItem, strings[currentItem] || "", md, config2, frontMatter, handleRuleFailures, noInlineConfig, resultVersion, lintWorkerCallback);
7867
7972
  } else if (concurrency === 0) {
7868
7973
  done = true;
7869
7974
  return callback(null, results);
7870
7975
  }
7871
7976
  return null;
7872
7977
  }
7873
- lintConcurrently();
7874
- lintConcurrently();
7875
- lintConcurrently();
7876
- lintConcurrently();
7877
- lintConcurrently();
7878
- lintConcurrently();
7879
- lintConcurrently();
7880
- lintConcurrently();
7978
+ if (synchronous) {
7979
+ while (!done) {
7980
+ lintWorker();
7981
+ }
7982
+ } else {
7983
+ lintWorker();
7984
+ lintWorker();
7985
+ lintWorker();
7986
+ lintWorker();
7987
+ lintWorker();
7988
+ lintWorker();
7989
+ lintWorker();
7990
+ lintWorker();
7991
+ }
7881
7992
  return null;
7882
7993
  }
7883
7994
  function markdownlint(options, callback) {
@@ -7901,11 +8012,12 @@ var require_markdownlint = __commonJS({
7901
8012
  let config2 = null;
7902
8013
  let message = "";
7903
8014
  const errors = [];
8015
+ let index = 0;
7904
8016
  (parsers || [JSON.parse]).every((parser) => {
7905
8017
  try {
7906
8018
  config2 = parser(content);
7907
8019
  } catch (error) {
7908
- errors.push(error.message);
8020
+ errors.push(`Parser ${index++}: ${error.message}`);
7909
8021
  }
7910
8022
  return !config2;
7911
8023
  });
@@ -8001,7 +8113,7 @@ var require_markdownlint = __commonJS({
8001
8113
  return config2;
8002
8114
  }
8003
8115
  function getVersion() {
8004
- return require_package().version;
8116
+ return require_constants().version;
8005
8117
  }
8006
8118
  markdownlint.sync = markdownlintSync;
8007
8119
  markdownlint.readConfig = readConfig;
@@ -8019,7 +8131,6 @@ var require_markdownlint = __commonJS({
8019
8131
  var require_helpers3 = __commonJS({
8020
8132
  "node_modules/markdownlint-rule-helpers/helpers.js"(exports, module2) {
8021
8133
  "use strict";
8022
- var os = require("os");
8023
8134
  var newLineRe = /\r\n?|\n/g;
8024
8135
  module2.exports.newLineRe = newLineRe;
8025
8136
  module2.exports.frontMatterRe = /((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$)|(^\{\s*$[^]*?^\}\s*$))(\r\n|\r|\n|$)/m;
@@ -8047,9 +8158,8 @@ var require_helpers3 = __commonJS({
8047
8158
  module2.exports.isObject = function isObject2(obj) {
8048
8159
  return obj !== null && typeof obj === "object" && !Array.isArray(obj);
8049
8160
  };
8050
- var blankLineRe = />|(?:<!--.*?-->)/g;
8051
8161
  module2.exports.isBlankLine = function isBlankLine(line) {
8052
- return !line || !line.trim() || !line.replace(blankLineRe, "").trim();
8162
+ return !line || !line.trim() || !line.replace(/<!--.*?-->/g, "").replace(/<!--.*$/g, "").replace(/^.*-->/g, "").replace(/>/g, "").trim();
8053
8163
  };
8054
8164
  module2.exports.numericSortAscending = function numericSortAscending(a, b) {
8055
8165
  return a - b;
@@ -8120,6 +8230,14 @@ var require_helpers3 = __commonJS({
8120
8230
  return "backtick";
8121
8231
  }
8122
8232
  };
8233
+ module2.exports.emphasisOrStrongStyleFor = function emphasisOrStrongStyleFor(markup) {
8234
+ switch (markup[0]) {
8235
+ case "*":
8236
+ return "asterisk";
8237
+ default:
8238
+ return "underscore";
8239
+ }
8240
+ };
8123
8241
  function indentFor(token) {
8124
8242
  const line = token.line.replace(/^[\s>]*(> |>)/, "");
8125
8243
  return line.length - line.trimStart().length;
@@ -8153,8 +8271,9 @@ var require_helpers3 = __commonJS({
8153
8271
  }
8154
8272
  module2.exports.filterTokens = filterTokens;
8155
8273
  function isMathBlock(token) {
8156
- return token.tag === "math" && token.type.startsWith("math_block") && !token.type.endsWith("_end");
8274
+ return (token.tag === "$$" || token.tag === "math") && token.type.startsWith("math_block") && !token.type.endsWith("_end");
8157
8275
  }
8276
+ module2.exports.isMathBlock = isMathBlock;
8158
8277
  module2.exports.getLineMetadata = function getLineMetadata(params) {
8159
8278
  const lineMetadata = params.lines.map((line, index) => [line, index, false, 0, false, false, false, false]);
8160
8279
  filterTokens(params, "fence", (token) => {
@@ -8191,11 +8310,12 @@ var require_helpers3 = __commonJS({
8191
8310
  });
8192
8311
  return lineMetadata;
8193
8312
  };
8194
- module2.exports.forEachLine = function forEachLine(lineMetadata, handler) {
8313
+ function forEachLine(lineMetadata, handler) {
8195
8314
  lineMetadata.forEach(function forMetadata(metadata) {
8196
8315
  handler(...metadata);
8197
8316
  });
8198
- };
8317
+ }
8318
+ module2.exports.forEachLine = forEachLine;
8199
8319
  module2.exports.flattenLists = function flattenLists(tokens) {
8200
8320
  const flattenedLists = [];
8201
8321
  const stack = [];
@@ -8204,9 +8324,6 @@ var require_helpers3 = __commonJS({
8204
8324
  const nestingStack = [];
8205
8325
  let lastWithMap = { "map": [0, 1] };
8206
8326
  tokens.forEach((token) => {
8207
- if (isMathBlock(token) && token.map[1]) {
8208
- token.map[1]++;
8209
- }
8210
8327
  if (token.type === "bullet_list_open" || token.type === "ordered_list_open") {
8211
8328
  stack.push(current);
8212
8329
  current = {
@@ -8344,13 +8461,26 @@ var require_helpers3 = __commonJS({
8344
8461
  }
8345
8462
  addError(onError, lineNumber, null, context, range, fixInfo);
8346
8463
  };
8347
- module2.exports.inlineCodeSpanRanges = (lines) => {
8464
+ module2.exports.codeBlockAndSpanRanges = (params, lineMetadata) => {
8348
8465
  const exclusions = [];
8349
- forEachInlineCodeSpan(lines.join("\n"), (code, lineIndex, columnIndex) => {
8350
- const codeLines = code.split(newLineRe);
8351
- for (let i = 0; i < codeLines.length; i++) {
8352
- exclusions.push([lineIndex + i, columnIndex, codeLines[i].length]);
8353
- columnIndex = 0;
8466
+ forEachLine(lineMetadata, (line, lineIndex, inCode, onFence) => {
8467
+ if (inCode && !onFence) {
8468
+ exclusions.push([lineIndex, 0, line.length]);
8469
+ }
8470
+ });
8471
+ filterTokens(params, "inline", (token) => {
8472
+ if (token.children.some((child) => child.type === "code_inline")) {
8473
+ const tokenLines = params.lines.slice(token.map[0], token.map[1]);
8474
+ forEachInlineCodeSpan(tokenLines.join("\n"), (code, lineIndex, columnIndex) => {
8475
+ const codeLines = code.split(newLineRe);
8476
+ for (const [i, line] of codeLines.entries()) {
8477
+ exclusions.push([
8478
+ token.lineNumber - 1 + lineIndex + i,
8479
+ i ? 0 : columnIndex,
8480
+ line.length
8481
+ ]);
8482
+ }
8483
+ });
8354
8484
  }
8355
8485
  });
8356
8486
  return exclusions;
@@ -8374,6 +8504,17 @@ var require_helpers3 = __commonJS({
8374
8504
  function emphasisMarkersInContent(params) {
8375
8505
  const { lines } = params;
8376
8506
  const byLine = new Array(lines.length);
8507
+ lines.forEach((tokenLine, tokenLineIndex) => {
8508
+ const inLine = [];
8509
+ let linkMatch = null;
8510
+ while (linkMatch = linkRe.exec(tokenLine)) {
8511
+ let markerMatch = null;
8512
+ while (markerMatch = emphasisMarkersRe.exec(linkMatch[0])) {
8513
+ inLine.push(linkMatch.index + markerMatch.index);
8514
+ }
8515
+ }
8516
+ byLine[tokenLineIndex] = inLine;
8517
+ });
8377
8518
  filterTokens(params, "inline", (token) => {
8378
8519
  const { children, lineNumber, map: map2 } = token;
8379
8520
  if (children.some((child) => child.type === "code_inline")) {
@@ -8381,33 +8522,22 @@ var require_helpers3 = __commonJS({
8381
8522
  forEachInlineCodeSpan(tokenLines.join("\n"), (code, lineIndex, column, tickCount) => {
8382
8523
  const codeLines = code.split(newLineRe);
8383
8524
  codeLines.forEach((codeLine, codeLineIndex) => {
8525
+ const byLineIndex = lineNumber - 1 + lineIndex + codeLineIndex;
8526
+ const inLine = byLine[byLineIndex];
8527
+ const codeLineOffset = codeLineIndex ? 0 : column - 1 + tickCount;
8384
8528
  let match = null;
8385
8529
  while (match = emphasisMarkersRe.exec(codeLine)) {
8386
- const byLineIndex = lineNumber - 1 + lineIndex + codeLineIndex;
8387
- const inLine = byLine[byLineIndex] || [];
8388
- const codeLineOffset = codeLineIndex ? 0 : column - 1 + tickCount;
8389
8530
  inLine.push(codeLineOffset + match.index);
8390
- byLine[byLineIndex] = inLine;
8391
8531
  }
8532
+ byLine[byLineIndex] = inLine;
8392
8533
  });
8393
8534
  });
8394
8535
  }
8395
8536
  });
8396
- lines.forEach((tokenLine, tokenLineIndex) => {
8397
- let linkMatch = null;
8398
- while (linkMatch = linkRe.exec(tokenLine)) {
8399
- let markerMatch = null;
8400
- while (markerMatch = emphasisMarkersRe.exec(linkMatch[0])) {
8401
- const inLine = byLine[tokenLineIndex] || [];
8402
- inLine.push(linkMatch.index + markerMatch.index);
8403
- byLine[tokenLineIndex] = inLine;
8404
- }
8405
- }
8406
- });
8407
8537
  return byLine;
8408
8538
  }
8409
8539
  module2.exports.emphasisMarkersInContent = emphasisMarkersInContent;
8410
- function getPreferredLineEnding(input) {
8540
+ function getPreferredLineEnding(input, platform) {
8411
8541
  let cr = 0;
8412
8542
  let lf = 0;
8413
8543
  let crlf = 0;
@@ -8427,7 +8557,7 @@ var require_helpers3 = __commonJS({
8427
8557
  });
8428
8558
  let preferredLineEnding = null;
8429
8559
  if (!cr && !lf && !crlf) {
8430
- preferredLineEnding = os.EOL;
8560
+ preferredLineEnding = (platform || process.platform) === "win32" ? "\r\n" : "\n";
8431
8561
  } else if (lf >= crlf && lf >= cr) {
8432
8562
  preferredLineEnding = "\n";
8433
8563
  } else if (crlf >= cr) {
@@ -8490,6 +8620,50 @@ var require_helpers3 = __commonJS({
8490
8620
  });
8491
8621
  return lines.filter((line) => line !== null).join(lineEnding);
8492
8622
  };
8623
+ function getRangeAndFixInfoIfFound(lines, lineIndex, search, replace) {
8624
+ let range = null;
8625
+ let fixInfo = null;
8626
+ const searchIndex = lines[lineIndex].indexOf(search);
8627
+ if (searchIndex !== -1) {
8628
+ const column = searchIndex + 1;
8629
+ const length = search.length;
8630
+ range = [column, length];
8631
+ fixInfo = {
8632
+ "editColumn": column,
8633
+ "deleteCount": length,
8634
+ "insertText": replace
8635
+ };
8636
+ }
8637
+ return {
8638
+ range,
8639
+ fixInfo
8640
+ };
8641
+ }
8642
+ module2.exports.getRangeAndFixInfoIfFound = getRangeAndFixInfoIfFound;
8643
+ function getNextChildToken(parentToken, childToken, nextType, nextNextType) {
8644
+ const { children } = parentToken;
8645
+ const index = children.indexOf(childToken);
8646
+ if (index !== -1 && children.length > index + 2 && children[index + 1].type === nextType && children[index + 2].type === nextNextType) {
8647
+ return children[index + 1];
8648
+ }
8649
+ return null;
8650
+ }
8651
+ module2.exports.getNextChildToken = getNextChildToken;
8652
+ function deepFreeze(obj) {
8653
+ const pending = [obj];
8654
+ let current = null;
8655
+ while (current = pending.shift()) {
8656
+ Object.freeze(current);
8657
+ for (const name of Object.getOwnPropertyNames(current)) {
8658
+ const value = current[name];
8659
+ if (value && typeof value === "object") {
8660
+ pending.push(value);
8661
+ }
8662
+ }
8663
+ }
8664
+ return obj;
8665
+ }
8666
+ module2.exports.deepFreeze = deepFreeze;
8493
8667
  }
8494
8668
  });
8495
8669
 
@@ -8510,7 +8684,7 @@ var require_ini = __commonJS({
8510
8684
  whitespace: false
8511
8685
  };
8512
8686
  } else {
8513
- opt = opt || Object.create(null);
8687
+ opt = opt || /* @__PURE__ */ Object.create(null);
8514
8688
  opt.whitespace = opt.whitespace === true;
8515
8689
  }
8516
8690
  var separator = opt.whitespace ? " = " : "=";
@@ -8546,7 +8720,7 @@ var require_ini = __commonJS({
8546
8720
  });
8547
8721
  }
8548
8722
  function decode(str2) {
8549
- var out = Object.create(null);
8723
+ var out = /* @__PURE__ */ Object.create(null);
8550
8724
  var p = out;
8551
8725
  var section = null;
8552
8726
  var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;
@@ -8560,10 +8734,10 @@ var require_ini = __commonJS({
8560
8734
  if (match[1] !== void 0) {
8561
8735
  section = unsafe(match[1]);
8562
8736
  if (section === "__proto__") {
8563
- p = Object.create(null);
8737
+ p = /* @__PURE__ */ Object.create(null);
8564
8738
  return;
8565
8739
  }
8566
- p = out[section] = out[section] || Object.create(null);
8740
+ p = out[section] = out[section] || /* @__PURE__ */ Object.create(null);
8567
8741
  return;
8568
8742
  }
8569
8743
  var key = unsafe(match[2]);
@@ -8601,7 +8775,7 @@ var require_ini = __commonJS({
8601
8775
  if (part === "__proto__")
8602
8776
  return;
8603
8777
  if (!p2[part] || typeof p2[part] !== "object")
8604
- p2[part] = Object.create(null);
8778
+ p2[part] = /* @__PURE__ */ Object.create(null);
8605
8779
  p2 = p2[part];
8606
8780
  });
8607
8781
  if (p2 === out && nl === l)
@@ -9053,15 +9227,16 @@ var require_rc = __commonJS({
9053
9227
  });
9054
9228
 
9055
9229
  // src/index.ts
9056
- __export(exports, {
9230
+ var src_exports = {};
9231
+ __export(src_exports, {
9057
9232
  activate: () => activate
9058
9233
  });
9059
- var import_coc2 = __toModule(require("coc.nvim"));
9234
+ var import_coc2 = require("coc.nvim");
9060
9235
 
9061
9236
  // src/engine.ts
9062
- var import_coc = __toModule(require("coc.nvim"));
9063
- var import_deep_extend = __toModule(require_deep_extend());
9064
- var import_fs = __toModule(require("fs"));
9237
+ var import_coc = require("coc.nvim");
9238
+ var import_deep_extend = __toESM(require_deep_extend());
9239
+ var import_fs = __toESM(require("fs"));
9065
9240
 
9066
9241
  // node_modules/js-yaml/dist/js-yaml.mjs
9067
9242
  function isNothing(subject) {
@@ -9949,7 +10124,7 @@ function fromDecimalCode(c) {
9949
10124
  return -1;
9950
10125
  }
9951
10126
  function simpleEscapeSequence(c) {
9952
- return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "" : c === 32 ? " " : c === 34 ? '"' : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "\x85" : c === 95 ? "\xA0" : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
10127
+ return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? '"' : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "\x85" : c === 95 ? "\xA0" : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
9953
10128
  }
9954
10129
  function charFromCodepoint(c) {
9955
10130
  if (c <= 65535) {
@@ -10350,7 +10525,7 @@ function readDoubleQuotedScalar(state, nodeIndent) {
10350
10525
  throwError(state, "unexpected end of the stream within a double quoted scalar");
10351
10526
  }
10352
10527
  function readFlowCollection(state, nodeIndent) {
10353
- var readNext = true, _line, _lineStart, _pos, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = Object.create(null), keyNode, keyTag, valueNode, ch;
10528
+ var readNext = true, _line, _lineStart, _pos, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = /* @__PURE__ */ Object.create(null), keyNode, keyTag, valueNode, ch;
10354
10529
  ch = state.input.charCodeAt(state.position);
10355
10530
  if (ch === 91) {
10356
10531
  terminator = 93;
@@ -10571,7 +10746,7 @@ function readBlockSequence(state, nodeIndent) {
10571
10746
  return false;
10572
10747
  }
10573
10748
  function readBlockMapping(state, nodeIndent, flowIndent) {
10574
- var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
10749
+ var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
10575
10750
  if (state.firstTabInLine !== -1)
10576
10751
  return false;
10577
10752
  if (state.anchor !== null) {
@@ -10922,8 +11097,8 @@ function readDocument(state) {
10922
11097
  var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
10923
11098
  state.version = null;
10924
11099
  state.checkLineBreaks = state.legacy;
10925
- state.tagMap = Object.create(null);
10926
- state.anchorMap = Object.create(null);
11100
+ state.tagMap = /* @__PURE__ */ Object.create(null);
11101
+ state.anchorMap = /* @__PURE__ */ Object.create(null);
10927
11102
  while ((ch = state.input.charCodeAt(state.position)) !== 0) {
10928
11103
  skipSeparationSpace(state, true, -1);
10929
11104
  ch = state.input.charCodeAt(state.position);
@@ -11715,10 +11890,10 @@ var jsYaml = {
11715
11890
  var js_yaml_default = jsYaml;
11716
11891
 
11717
11892
  // src/engine.ts
11718
- var import_markdownlint = __toModule(require_markdownlint());
11719
- var import_markdownlint_rule_helpers = __toModule(require_helpers3());
11720
- var import_path = __toModule(require("path"));
11721
- var import_rc = __toModule(require_rc());
11893
+ var import_markdownlint = __toESM(require_markdownlint());
11894
+ var import_markdownlint_rule_helpers = __toESM(require_helpers3());
11895
+ var import_path = __toESM(require("path"));
11896
+ var import_rc = __toESM(require_rc());
11722
11897
  var projectConfigFiles = [".markdownlint.json", ".markdownlint.yaml", ".markdownlint.yml"];
11723
11898
  var configFileParsers = [JSON.parse, js_yaml_default.load];
11724
11899
  var MarkdownlintEngine = class {
@@ -11942,6 +12117,7 @@ async function activate(context) {
11942
12117
  didOpenTextDocument(doc.textDocument);
11943
12118
  });
11944
12119
  }
12120
+ module.exports = __toCommonJS(src_exports);
11945
12121
  // Annotate the CommonJS export names for ESM import in node:
11946
12122
  0 && (module.exports = {
11947
12123
  activate