coc-markdownlint 1.12.5 → 1.12.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.
Files changed (2) hide show
  1. package/lib/index.js +902 -317
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -20,7 +20,10 @@ var __copyProps = (to, from, except, desc) => {
20
20
  }
21
21
  return to;
22
22
  };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
24
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
28
 
26
29
  // node_modules/deep-extend/lib/deep-extend.js
@@ -1582,7 +1585,11 @@ var require_smartquotes = __commonJS({
1582
1585
  closeQuote = state.md.options.quotes[1];
1583
1586
  }
1584
1587
  token.content = replaceAt(token.content, t.index, closeQuote);
1585
- tokens[item.token].content = replaceAt(tokens[item.token].content, item.pos, openQuote);
1588
+ tokens[item.token].content = replaceAt(
1589
+ tokens[item.token].content,
1590
+ item.pos,
1591
+ openQuote
1592
+ );
1586
1593
  pos += closeQuote.length - 1;
1587
1594
  if (item.token === i) {
1588
1595
  pos += openQuote.length - 1;
@@ -3801,7 +3808,12 @@ var require_image = __commonJS({
3801
3808
  }
3802
3809
  if (!silent) {
3803
3810
  content = state.src.slice(labelStart, labelEnd);
3804
- state.md.inline.parse(content, state.md, state.env, tokens = []);
3811
+ state.md.inline.parse(
3812
+ content,
3813
+ state.md,
3814
+ state.env,
3815
+ tokens = []
3816
+ );
3805
3817
  token = state.push("image", "img", 0);
3806
3818
  token.attrs = attrs = [["src", href], ["alt", ""]];
3807
3819
  token.children = tokens;
@@ -4364,7 +4376,10 @@ var require_linkify_it = __commonJS({
4364
4376
  validate: function(text, pos, self) {
4365
4377
  var tail = text.slice(pos);
4366
4378
  if (!self.re.http) {
4367
- self.re.http = new RegExp("^\\/\\/" + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, "i");
4379
+ self.re.http = new RegExp(
4380
+ "^\\/\\/" + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path,
4381
+ "i"
4382
+ );
4368
4383
  }
4369
4384
  if (self.re.http.test(tail)) {
4370
4385
  return tail.match(self.re.http)[0].length;
@@ -4378,7 +4393,10 @@ var require_linkify_it = __commonJS({
4378
4393
  validate: function(text, pos, self) {
4379
4394
  var tail = text.slice(pos);
4380
4395
  if (!self.re.no_http) {
4381
- self.re.no_http = new RegExp("^" + self.re.src_auth + "(?:localhost|(?:(?:" + self.re.src_domain + ")\\.)+" + self.re.src_domain_root + ")" + self.re.src_port + self.re.src_host_terminator + self.re.src_path, "i");
4396
+ self.re.no_http = new RegExp(
4397
+ "^" + self.re.src_auth + "(?:localhost|(?:(?:" + self.re.src_domain + ")\\.)+" + self.re.src_domain_root + ")" + self.re.src_port + self.re.src_host_terminator + self.re.src_path,
4398
+ "i"
4399
+ );
4382
4400
  }
4383
4401
  if (self.re.no_http.test(tail)) {
4384
4402
  if (pos >= 3 && text[pos - 3] === ":") {
@@ -4396,7 +4414,10 @@ var require_linkify_it = __commonJS({
4396
4414
  validate: function(text, pos, self) {
4397
4415
  var tail = text.slice(pos);
4398
4416
  if (!self.re.mailto) {
4399
- self.re.mailto = new RegExp("^" + self.re.src_email_name + "@" + self.re.src_host_strict, "i");
4417
+ self.re.mailto = new RegExp(
4418
+ "^" + self.re.src_email_name + "@" + self.re.src_host_strict,
4419
+ "i"
4420
+ );
4400
4421
  }
4401
4422
  if (self.re.mailto.test(tail)) {
4402
4423
  return tail.match(self.re.mailto)[0].length;
@@ -4490,7 +4511,10 @@ var require_linkify_it = __commonJS({
4490
4511
  self.re.schema_test = RegExp("(^|(?!_)(?:[><\uFF5C]|" + re.src_ZPCc + "))(" + slist + ")", "i");
4491
4512
  self.re.schema_search = RegExp("(^|(?!_)(?:[><\uFF5C]|" + re.src_ZPCc + "))(" + slist + ")", "ig");
4492
4513
  self.re.schema_at_start = RegExp("^" + self.re.schema_search.source, "i");
4493
- self.re.pretest = RegExp("(" + self.re.schema_test.source + ")|(" + self.re.host_fuzzy_test.source + ")|@", "i");
4514
+ self.re.pretest = RegExp(
4515
+ "(" + self.re.schema_test.source + ")|(" + self.re.host_fuzzy_test.source + ")|@",
4516
+ "i"
4517
+ );
4494
4518
  resetScanCache(self);
4495
4519
  }
4496
4520
  function Match(self, shift) {
@@ -4976,7 +5000,7 @@ var require_constants = __commonJS({
4976
5000
  "use strict";
4977
5001
  module2.exports.deprecatedRuleNames = ["MD002", "MD006"];
4978
5002
  module2.exports.homepage = "https://github.com/DavidAnson/markdownlint";
4979
- module2.exports.version = "0.26.0";
5003
+ module2.exports.version = "0.26.1";
4980
5004
  }
4981
5005
  });
4982
5006
 
@@ -5145,7 +5169,9 @@ var require_helpers2 = __commonJS({
5145
5169
  }
5146
5170
  module2.exports.isMathBlock = isMathBlock;
5147
5171
  module2.exports.getLineMetadata = function getLineMetadata(params) {
5148
- const lineMetadata = params.lines.map((line, index) => [line, index, false, 0, false, false, false, false]);
5172
+ const lineMetadata = params.lines.map(
5173
+ (line, index) => [line, index, false, 0, false, false, false, false]
5174
+ );
5149
5175
  filterTokens(params, "fence", (token) => {
5150
5176
  lineMetadata[token.map[0]][3] = 1;
5151
5177
  lineMetadata[token.map[1] - 1][3] = -1;
@@ -5278,7 +5304,12 @@ var require_helpers2 = __commonJS({
5278
5304
  lineStartIndex = newLineIndex + 1;
5279
5305
  }
5280
5306
  const columnIndex = startIndex - lineStartIndex + startLength;
5281
- handler(input.slice(startIndex + startLength, endIndex), lineIndex, columnIndex, startLength);
5307
+ handler(
5308
+ input.slice(startIndex + startLength, endIndex),
5309
+ lineIndex,
5310
+ columnIndex,
5311
+ startLength
5312
+ );
5282
5313
  i = j;
5283
5314
  break;
5284
5315
  }
@@ -5311,7 +5342,14 @@ var require_helpers2 = __commonJS({
5311
5342
  module2.exports.addError = addError;
5312
5343
  module2.exports.addErrorDetailIf = function addErrorDetailIf(onError, lineNumber, expected, actual, detail, context, range, fixInfo) {
5313
5344
  if (expected !== actual) {
5314
- addError(onError, lineNumber, "Expected: " + expected + "; Actual: " + actual + (detail ? "; " + detail : ""), context, range, fixInfo);
5345
+ addError(
5346
+ onError,
5347
+ lineNumber,
5348
+ "Expected: " + expected + "; Actual: " + actual + (detail ? "; " + detail : ""),
5349
+ context,
5350
+ range,
5351
+ fixInfo
5352
+ );
5315
5353
  }
5316
5354
  };
5317
5355
  module2.exports.addErrorContext = function addErrorContext(onError, lineNumber, context, left, right, range, fixInfo) {
@@ -5328,16 +5366,19 @@ var require_helpers2 = __commonJS({
5328
5366
  filterTokens(params, "inline", (token) => {
5329
5367
  if (token.children.some((child) => child.type === "code_inline")) {
5330
5368
  const tokenLines = params.lines.slice(token.map[0], token.map[1]);
5331
- forEachInlineCodeSpan(tokenLines.join("\n"), (code, lineIndex, columnIndex) => {
5332
- const codeLines = code.split(newLineRe);
5333
- for (const [i, line] of codeLines.entries()) {
5334
- exclusions.push([
5335
- token.lineNumber - 1 + lineIndex + i,
5336
- i ? 0 : columnIndex,
5337
- line.length
5338
- ]);
5369
+ forEachInlineCodeSpan(
5370
+ tokenLines.join("\n"),
5371
+ (code, lineIndex, columnIndex) => {
5372
+ const codeLines = code.split(newLineRe);
5373
+ for (const [i, line] of codeLines.entries()) {
5374
+ exclusions.push([
5375
+ token.lineNumber - 1 + lineIndex + i,
5376
+ i ? 0 : columnIndex,
5377
+ line.length
5378
+ ]);
5379
+ }
5339
5380
  }
5340
- });
5381
+ );
5341
5382
  }
5342
5383
  });
5343
5384
  return exclusions;
@@ -5366,7 +5407,10 @@ var require_helpers2 = __commonJS({
5366
5407
  };
5367
5408
  module2.exports.frontMatterHasTitle = function frontMatterHasTitle(frontMatterLines, frontMatterTitlePattern) {
5368
5409
  const ignoreFrontMatter = frontMatterTitlePattern !== void 0 && !frontMatterTitlePattern;
5369
- const frontMatterTitleRe = new RegExp(String(frontMatterTitlePattern || '^\\s*"?title"?\\s*[:=]'), "i");
5410
+ const frontMatterTitleRe = new RegExp(
5411
+ String(frontMatterTitlePattern || '^\\s*"?title"?\\s*[:=]'),
5412
+ "i"
5413
+ );
5370
5414
  return !ignoreFrontMatter && frontMatterLines.some((line) => frontMatterTitleRe.test(line));
5371
5415
  };
5372
5416
  function forEachLink(line, handler) {
@@ -5446,19 +5490,22 @@ var require_helpers2 = __commonJS({
5446
5490
  const { children, lineNumber, map: map2 } = token;
5447
5491
  if (children.some((child) => child.type === "code_inline")) {
5448
5492
  const tokenLines = lines.slice(map2[0], map2[1]);
5449
- forEachInlineCodeSpan(tokenLines.join("\n"), (code, lineIndex, column, tickCount) => {
5450
- const codeLines = code.split(newLineRe);
5451
- for (const [codeLineIndex, codeLine] of codeLines.entries()) {
5452
- const byLineIndex = lineNumber - 1 + lineIndex + codeLineIndex;
5453
- const inLine = byLine[byLineIndex];
5454
- const codeLineOffset = codeLineIndex ? 0 : column - 1 + tickCount;
5455
- let match = null;
5456
- while (match = emphasisMarkersRe.exec(codeLine)) {
5457
- inLine.push(codeLineOffset + match.index);
5493
+ forEachInlineCodeSpan(
5494
+ tokenLines.join("\n"),
5495
+ (code, lineIndex, column, tickCount) => {
5496
+ const codeLines = code.split(newLineRe);
5497
+ for (const [codeLineIndex, codeLine] of codeLines.entries()) {
5498
+ const byLineIndex = lineNumber - 1 + lineIndex + codeLineIndex;
5499
+ const inLine = byLine[byLineIndex];
5500
+ const codeLineOffset = codeLineIndex ? 0 : column - 1 + tickCount;
5501
+ let match = null;
5502
+ while (match = emphasisMarkersRe.exec(codeLine)) {
5503
+ inLine.push(codeLineOffset + match.index);
5504
+ }
5505
+ byLine[byLineIndex] = inLine;
5458
5506
  }
5459
- byLine[byLineIndex] = inLine;
5460
5507
  }
5461
- });
5508
+ );
5462
5509
  }
5463
5510
  });
5464
5511
  return byLine;
@@ -5471,7 +5518,12 @@ var require_helpers2 = __commonJS({
5471
5518
  const duplicateDefinitions = [];
5472
5519
  const normalizeLabel = (s) => s.toLowerCase().trim().replace(/\s+/g, " ");
5473
5520
  const exclusions = [];
5474
- const excluded = (match) => withinAnyRange(exclusions, 0, match.index, match[0].length);
5521
+ const excluded = (match) => withinAnyRange(
5522
+ exclusions,
5523
+ 0,
5524
+ match.index,
5525
+ match[0].length
5526
+ );
5475
5527
  const lineOffsets = [];
5476
5528
  let currentOffset = 0;
5477
5529
  const contentLines = [];
@@ -5522,7 +5574,9 @@ var require_helpers2 = __commonJS({
5522
5574
  if (!matchString.startsWith("\\") && !matchString.startsWith("!\\") && !matchText.endsWith("\\") && !(matchLabel || "").endsWith("\\") && (topLevel || matchString.startsWith("!")) && !excluded(referenceLinkMatch)) {
5523
5575
  const shortcutLink = matchLabel === void 0;
5524
5576
  const collapsedLink = !shortcutLink && matchLabel.length === 0;
5525
- const label = normalizeLabel(shortcutLink || collapsedLink ? matchText : matchLabel);
5577
+ const label = normalizeLabel(
5578
+ shortcutLink || collapsedLink ? matchText : matchLabel
5579
+ );
5526
5580
  if (label.length > 0) {
5527
5581
  if (shortcutLink) {
5528
5582
  shortcuts.add(label);
@@ -5544,12 +5598,14 @@ var require_helpers2 = __commonJS({
5544
5598
  ]);
5545
5599
  references.set(label, referenceData);
5546
5600
  if (!matchString.startsWith("!")) {
5547
- pendingContents.push({
5548
- "content": matchText,
5549
- "contentLineIndex": lineIndex,
5550
- "contentIndex": referenceIndex + 1,
5551
- "topLevel": false
5552
- });
5601
+ pendingContents.push(
5602
+ {
5603
+ "content": matchText,
5604
+ "contentLineIndex": lineIndex,
5605
+ "contentIndex": referenceIndex + 1,
5606
+ "topLevel": false
5607
+ }
5608
+ );
5553
5609
  }
5554
5610
  }
5555
5611
  }
@@ -5683,7 +5739,7 @@ var require_helpers2 = __commonJS({
5683
5739
  }
5684
5740
  module2.exports.getNextChildToken = getNextChildToken;
5685
5741
  function expandTildePath(file, os) {
5686
- const homedir = os && os.homedir();
5742
+ const homedir = os && os.homedir && os.homedir();
5687
5743
  return homedir ? file.replace(/^~($|\/|\\)/, `${homedir}$1`) : file;
5688
5744
  }
5689
5745
  module2.exports.expandTildePath = expandTildePath;
@@ -5704,7 +5760,12 @@ var require_md001 = __commonJS({
5704
5760
  filterTokens(params, "heading_open", function forToken(token) {
5705
5761
  const level = Number.parseInt(token.tag.slice(1), 10);
5706
5762
  if (prevLevel && level > prevLevel) {
5707
- addErrorDetailIf(onError, token.lineNumber, "h" + (prevLevel + 1), "h" + level);
5763
+ addErrorDetailIf(
5764
+ onError,
5765
+ token.lineNumber,
5766
+ "h" + (prevLevel + 1),
5767
+ "h" + level
5768
+ );
5708
5769
  }
5709
5770
  prevLevel = level;
5710
5771
  });
@@ -5764,7 +5825,12 @@ var require_md003 = __commonJS({
5764
5825
  } else if (style === "setext_with_atx_closed") {
5765
5826
  expected = h12 ? "setext" : "atx_closed";
5766
5827
  }
5767
- addErrorDetailIf(onError, token.lineNumber, expected, styleForToken);
5828
+ addErrorDetailIf(
5829
+ onError,
5830
+ token.lineNumber,
5831
+ expected,
5832
+ styleForToken
5833
+ );
5768
5834
  }
5769
5835
  }
5770
5836
  });
@@ -5847,7 +5913,16 @@ var require_md004 = __commonJS({
5847
5913
  "insertText": expectedStyleToMarker[expectedStyle]
5848
5914
  };
5849
5915
  }
5850
- addErrorDetailIf(onError, item.lineNumber, expectedStyle, itemStyle, null, null, range, fixInfo);
5916
+ addErrorDetailIf(
5917
+ onError,
5918
+ item.lineNumber,
5919
+ expectedStyle,
5920
+ itemStyle,
5921
+ null,
5922
+ null,
5923
+ range,
5924
+ fixInfo
5925
+ );
5851
5926
  }
5852
5927
  }
5853
5928
  }
@@ -5884,7 +5959,15 @@ var require_md005 = __commonJS({
5884
5959
  const actualIndent = indentFor(item);
5885
5960
  let match = null;
5886
5961
  if (list.unordered) {
5887
- addErrorDetailIf(onError, lineNumber, expectedIndent, actualIndent, null, null, rangeFromRegExp(line, listItemMarkerRe));
5962
+ addErrorDetailIf(
5963
+ onError,
5964
+ lineNumber,
5965
+ expectedIndent,
5966
+ actualIndent,
5967
+ null,
5968
+ null,
5969
+ rangeFromRegExp(line, listItemMarkerRe)
5970
+ );
5888
5971
  } else if (match = orderedListItemMarkerRe.exec(line)) {
5889
5972
  actualEnd = match[0].length;
5890
5973
  expectedEnd = expectedEnd || actualEnd;
@@ -5896,11 +5979,18 @@ var require_md005 = __commonJS({
5896
5979
  const detail = endMatching ? `Expected: (${expectedEnd}); Actual: (${actualEnd})` : `Expected: ${expectedIndent}; Actual: ${actualIndent}`;
5897
5980
  const expected = endMatching ? expectedEnd - markerLength : expectedIndent;
5898
5981
  const actual = endMatching ? actualEnd - markerLength : actualIndent;
5899
- addError(onError, lineNumber, detail, null, rangeFromRegExp(line, listItemMarkerRe), {
5900
- "editColumn": Math.min(actual, expected) + 1,
5901
- "deleteCount": Math.max(actual - expected, 0),
5902
- "insertText": "".padEnd(Math.max(expected - actual, 0))
5903
- });
5982
+ addError(
5983
+ onError,
5984
+ lineNumber,
5985
+ detail,
5986
+ null,
5987
+ rangeFromRegExp(line, listItemMarkerRe),
5988
+ {
5989
+ "editColumn": Math.min(actual, expected) + 1,
5990
+ "deleteCount": Math.max(actual - expected, 0),
5991
+ "insertText": "".padEnd(Math.max(expected - actual, 0))
5992
+ }
5993
+ );
5904
5994
  }
5905
5995
  }
5906
5996
  }
@@ -5926,9 +6016,18 @@ var require_md006 = __commonJS({
5926
6016
  if (list.unordered && !list.nesting && list.indent !== 0) {
5927
6017
  for (const item of list.items) {
5928
6018
  const { lineNumber, line } = item;
5929
- addErrorDetailIf(onError, lineNumber, 0, list.indent, null, null, rangeFromRegExp(line, listItemMarkerRe), {
5930
- "deleteCount": line.length - line.trimStart().length
5931
- });
6019
+ addErrorDetailIf(
6020
+ onError,
6021
+ lineNumber,
6022
+ 0,
6023
+ list.indent,
6024
+ null,
6025
+ null,
6026
+ rangeFromRegExp(line, listItemMarkerRe),
6027
+ {
6028
+ "deleteCount": line.length - line.trimStart().length
6029
+ }
6030
+ );
5932
6031
  }
5933
6032
  }
5934
6033
  }
@@ -5964,11 +6063,20 @@ var require_md007 = __commonJS({
5964
6063
  range = [1, match[0].length];
5965
6064
  editColumn += match[1].length - actualIndent;
5966
6065
  }
5967
- addErrorDetailIf(onError, lineNumber, expectedIndent, actualIndent, null, null, range, {
5968
- editColumn,
5969
- "deleteCount": actualIndent,
5970
- "insertText": "".padEnd(expectedIndent)
5971
- });
6066
+ addErrorDetailIf(
6067
+ onError,
6068
+ lineNumber,
6069
+ expectedIndent,
6070
+ actualIndent,
6071
+ null,
6072
+ null,
6073
+ range,
6074
+ {
6075
+ editColumn,
6076
+ "deleteCount": actualIndent,
6077
+ "insertText": "".padEnd(expectedIndent)
6078
+ }
6079
+ );
5972
6080
  }
5973
6081
  }
5974
6082
  }
@@ -6042,10 +6150,17 @@ var require_md009 = __commonJS({
6042
6150
  const trailingSpaces = line.length - line.trimEnd().length;
6043
6151
  if (trailingSpaces && !inCode && !includesSorted(listItemLineNumbers, lineNumber) && (expected !== trailingSpaces || strict && (!includesSorted(paragraphLineNumbers, lineNumber) || includesSorted(codeInlineLineNumbers, lineNumber)))) {
6044
6152
  const column = line.length - trailingSpaces + 1;
6045
- addError(onError, lineNumber, "Expected: " + (expected === 0 ? "" : "0 or ") + expected + "; Actual: " + trailingSpaces, void 0, [column, trailingSpaces], {
6046
- "editColumn": column,
6047
- "deleteCount": trailingSpaces
6048
- });
6153
+ addError(
6154
+ onError,
6155
+ lineNumber,
6156
+ "Expected: " + (expected === 0 ? "" : "0 or ") + expected + "; Actual: " + trailingSpaces,
6157
+ void 0,
6158
+ [column, trailingSpaces],
6159
+ {
6160
+ "editColumn": column,
6161
+ "deleteCount": trailingSpaces
6162
+ }
6163
+ );
6049
6164
  }
6050
6165
  });
6051
6166
  }
@@ -6067,7 +6182,9 @@ var require_md010 = __commonJS({
6067
6182
  "function": function MD010(params, onError) {
6068
6183
  const codeBlocks = params.config.code_blocks;
6069
6184
  const includeCode = codeBlocks === void 0 ? true : !!codeBlocks;
6070
- const ignoreCodeLanguages = new Set((params.config.ignore_code_languages || []).map((language) => language.toLowerCase()));
6185
+ const ignoreCodeLanguages = new Set(
6186
+ (params.config.ignore_code_languages || []).map((language) => language.toLowerCase())
6187
+ );
6071
6188
  const spacesPerTab = params.config.spaces_per_tab;
6072
6189
  const spaceMultiplier = spacesPerTab === void 0 ? 1 : Math.max(0, Number(spacesPerTab));
6073
6190
  const exclusions = includeCode ? [] : codeBlockAndSpanRanges();
@@ -6087,11 +6204,18 @@ var require_md010 = __commonJS({
6087
6204
  const column = index + 1;
6088
6205
  const length = match[0].length;
6089
6206
  if (!withinAnyRange(exclusions, lineIndex, index, length)) {
6090
- addError(onError, lineIndex + 1, "Column: " + column, null, [column, length], {
6091
- "editColumn": column,
6092
- "deleteCount": length,
6093
- "insertText": "".padEnd(length * spaceMultiplier)
6094
- });
6207
+ addError(
6208
+ onError,
6209
+ lineIndex + 1,
6210
+ "Column: " + column,
6211
+ null,
6212
+ [column, length],
6213
+ {
6214
+ "editColumn": column,
6215
+ "deleteCount": length,
6216
+ "insertText": "".padEnd(length * spaceMultiplier)
6217
+ }
6218
+ );
6095
6219
  }
6096
6220
  }
6097
6221
  }
@@ -6122,11 +6246,18 @@ var require_md011 = __commonJS({
6122
6246
  const index = match.index + preChar.length;
6123
6247
  const length = match[0].length - preChar.length;
6124
6248
  if (!linkText.endsWith("\\") && !linkDestination.endsWith("\\") && !withinAnyRange(exclusions, lineIndex, index, length)) {
6125
- addError(onError, lineIndex + 1, reversedLink.slice(preChar.length), null, [index + 1, length], {
6126
- "editColumn": index + 1,
6127
- "deleteCount": length,
6128
- "insertText": `[${linkText}](${linkDestination})`
6129
- });
6249
+ addError(
6250
+ onError,
6251
+ lineIndex + 1,
6252
+ reversedLink.slice(preChar.length),
6253
+ null,
6254
+ [index + 1, length],
6255
+ {
6256
+ "editColumn": index + 1,
6257
+ "deleteCount": length,
6258
+ "insertText": `[${linkText}](${linkDestination})`
6259
+ }
6260
+ );
6130
6261
  }
6131
6262
  }
6132
6263
  }
@@ -6152,9 +6283,18 @@ var require_md012 = __commonJS({
6152
6283
  forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
6153
6284
  count = inCode || line.trim().length > 0 ? 0 : count + 1;
6154
6285
  if (maximum < count) {
6155
- addErrorDetailIf(onError, lineIndex + 1, maximum, count, null, null, null, {
6156
- "deleteCount": -1
6157
- });
6286
+ addErrorDetailIf(
6287
+ onError,
6288
+ lineIndex + 1,
6289
+ maximum,
6290
+ count,
6291
+ null,
6292
+ null,
6293
+ null,
6294
+ {
6295
+ "deleteCount": -1
6296
+ }
6297
+ );
6158
6298
  }
6159
6299
  });
6160
6300
  }
@@ -6235,7 +6375,15 @@ var require_md013 = __commonJS({
6235
6375
  const length = inCode ? codeLineLength : isHeading ? headingLineLength : lineLength;
6236
6376
  const lengthRe = inCode ? longCodeLineRe : isHeading ? longHeadingLineRe : longLineRe;
6237
6377
  if ((includeCodeBlocks || !inCode) && (includeTables || !inTable) && (includeHeadings || !isHeading) && (strict || !(stern && sternModeRe.test(line)) && !includesSorted(linkOnlyLineNumbers, lineNumber) && !linkReferenceDefinitionRe.test(line)) && lengthRe.test(line)) {
6238
- addErrorDetailIf(onError, lineNumber, length, line.length, null, null, [length + 1, line.length - length]);
6378
+ addErrorDetailIf(
6379
+ onError,
6380
+ lineNumber,
6381
+ length,
6382
+ line.length,
6383
+ null,
6384
+ null,
6385
+ [length + 1, line.length - length]
6386
+ );
6239
6387
  }
6240
6388
  });
6241
6389
  }
@@ -6276,10 +6424,18 @@ var require_md014 = __commonJS({
6276
6424
  if (allDollars) {
6277
6425
  for (const instance of dollarInstances) {
6278
6426
  const [i, lineTrim, column, length] = instance;
6279
- addErrorContext(onError, i + 1, lineTrim, null, null, [column, length], {
6280
- "editColumn": column,
6281
- "deleteCount": length
6282
- });
6427
+ addErrorContext(
6428
+ onError,
6429
+ i + 1,
6430
+ lineTrim,
6431
+ null,
6432
+ null,
6433
+ [column, length],
6434
+ {
6435
+ "editColumn": column,
6436
+ "deleteCount": length
6437
+ }
6438
+ );
6283
6439
  }
6284
6440
  }
6285
6441
  });
@@ -6303,10 +6459,18 @@ var require_md018 = __commonJS({
6303
6459
  forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
6304
6460
  if (!inCode && /^#+[^# \t]/.test(line) && !/#\s*$/.test(line) && !line.startsWith("#\uFE0F\u20E3")) {
6305
6461
  const hashCount = /^#+/.exec(line)[0].length;
6306
- addErrorContext(onError, lineIndex + 1, line.trim(), null, null, [1, hashCount + 1], {
6307
- "editColumn": hashCount + 1,
6308
- "insertText": " "
6309
- });
6462
+ addErrorContext(
6463
+ onError,
6464
+ lineIndex + 1,
6465
+ line.trim(),
6466
+ null,
6467
+ null,
6468
+ [1, hashCount + 1],
6469
+ {
6470
+ "editColumn": hashCount + 1,
6471
+ "insertText": " "
6472
+ }
6473
+ );
6310
6474
  }
6311
6475
  });
6312
6476
  }
@@ -6334,10 +6498,18 @@ var require_md019 = __commonJS({
6334
6498
  { "length": hashLength },
6335
6499
  { "length": spacesLength }
6336
6500
  ] = match;
6337
- addErrorContext(onError, lineNumber, line.trim(), null, null, [1, hashLength + spacesLength + 1], {
6338
- "editColumn": hashLength + 1,
6339
- "deleteCount": spacesLength - 1
6340
- });
6501
+ addErrorContext(
6502
+ onError,
6503
+ lineNumber,
6504
+ line.trim(),
6505
+ null,
6506
+ null,
6507
+ [1, hashLength + spacesLength + 1],
6508
+ {
6509
+ "editColumn": hashLength + 1,
6510
+ "deleteCount": spacesLength - 1
6511
+ }
6512
+ );
6341
6513
  }
6342
6514
  }
6343
6515
  });
@@ -6384,11 +6556,19 @@ var require_md020 = __commonJS({
6384
6556
  line.length - trailSpaceLength - rightHashLength,
6385
6557
  rightHashLength + 1
6386
6558
  ];
6387
- addErrorContext(onError, lineIndex + 1, line.trim(), left, right, range, {
6388
- "editColumn": 1,
6389
- "deleteCount": line.length,
6390
- "insertText": `${leftHash} ${content} ${rightEscapeReplacement}${rightHash}`
6391
- });
6559
+ addErrorContext(
6560
+ onError,
6561
+ lineIndex + 1,
6562
+ line.trim(),
6563
+ left,
6564
+ right,
6565
+ range,
6566
+ {
6567
+ "editColumn": 1,
6568
+ "deleteCount": line.length,
6569
+ "insertText": `${leftHash} ${content} ${rightEscapeReplacement}${rightHash}`
6570
+ }
6571
+ );
6392
6572
  }
6393
6573
  }
6394
6574
  }
@@ -6436,11 +6616,19 @@ var require_md021 = __commonJS({
6436
6616
  length - trailSpaceLength - rightHashLength - rightSpaceLength,
6437
6617
  rightSpaceLength + rightHashLength + 1
6438
6618
  ];
6439
- addErrorContext(onError, lineNumber, line.trim(), left, right, range, {
6440
- "editColumn": 1,
6441
- "deleteCount": length,
6442
- "insertText": `${leftHash} ${content} ${rightHash}`
6443
- });
6619
+ addErrorContext(
6620
+ onError,
6621
+ lineNumber,
6622
+ line.trim(),
6623
+ left,
6624
+ right,
6625
+ range,
6626
+ {
6627
+ "editColumn": 1,
6628
+ "deleteCount": length,
6629
+ "insertText": `${leftHash} ${content} ${rightHash}`
6630
+ }
6631
+ );
6444
6632
  }
6445
6633
  }
6446
6634
  }
@@ -6473,19 +6661,37 @@ var require_md022 = __commonJS({
6473
6661
  actualAbove++;
6474
6662
  }
6475
6663
  }
6476
- addErrorDetailIf(onError, topIndex + 1, linesAbove, actualAbove, "Above", lines[topIndex].trim(), null, {
6477
- "insertText": "".padEnd(linesAbove - actualAbove, "\n")
6478
- });
6664
+ addErrorDetailIf(
6665
+ onError,
6666
+ topIndex + 1,
6667
+ linesAbove,
6668
+ actualAbove,
6669
+ "Above",
6670
+ lines[topIndex].trim(),
6671
+ null,
6672
+ {
6673
+ "insertText": "".padEnd(linesAbove - actualAbove, "\n")
6674
+ }
6675
+ );
6479
6676
  let actualBelow = 0;
6480
6677
  for (let i = 0; i < linesBelow; i++) {
6481
6678
  if (isBlankLine(lines[nextIndex + i])) {
6482
6679
  actualBelow++;
6483
6680
  }
6484
6681
  }
6485
- addErrorDetailIf(onError, topIndex + 1, linesBelow, actualBelow, "Below", lines[topIndex].trim(), null, {
6486
- "lineNumber": nextIndex + 1,
6487
- "insertText": "".padEnd(linesBelow - actualBelow, "\n")
6488
- });
6682
+ addErrorDetailIf(
6683
+ onError,
6684
+ topIndex + 1,
6685
+ linesBelow,
6686
+ actualBelow,
6687
+ "Below",
6688
+ lines[topIndex].trim(),
6689
+ null,
6690
+ {
6691
+ "lineNumber": nextIndex + 1,
6692
+ "insertText": "".padEnd(linesBelow - actualBelow, "\n")
6693
+ }
6694
+ );
6489
6695
  });
6490
6696
  }
6491
6697
  };
@@ -6513,10 +6719,18 @@ var require_md023 = __commonJS({
6513
6719
  if (prefixLengthNoSpace) {
6514
6720
  deleteCount -= prefixLengthNoSpace - 1;
6515
6721
  }
6516
- addErrorContext(onError, lineNumber, line, null, null, [1, prefixAndFirstChar.length], {
6517
- "editColumn": prefixLengthNoSpace + 1,
6518
- "deleteCount": deleteCount
6519
- });
6722
+ addErrorContext(
6723
+ onError,
6724
+ lineNumber,
6725
+ line,
6726
+ null,
6727
+ null,
6728
+ [1, prefixAndFirstChar.length],
6729
+ {
6730
+ "editColumn": prefixLengthNoSpace + 1,
6731
+ "deleteCount": deleteCount
6732
+ }
6733
+ );
6520
6734
  }
6521
6735
  });
6522
6736
  }
@@ -6552,7 +6766,11 @@ var require_md024 = __commonJS({
6552
6766
  knownContent = knownContents[newLevel];
6553
6767
  }
6554
6768
  if (knownContent.includes(content)) {
6555
- addErrorContext(onError, heading.lineNumber, heading.line.trim());
6769
+ addErrorContext(
6770
+ onError,
6771
+ heading.lineNumber,
6772
+ heading.line.trim()
6773
+ );
6556
6774
  } else {
6557
6775
  knownContent.push(content);
6558
6776
  }
@@ -6574,12 +6792,19 @@ var require_md025 = __commonJS({
6574
6792
  "function": function MD025(params, onError) {
6575
6793
  const level = Number(params.config.level || 1);
6576
6794
  const tag = "h" + level;
6577
- const foundFrontMatterTitle = frontMatterHasTitle(params.frontMatterLines, params.config.front_matter_title);
6795
+ const foundFrontMatterTitle = frontMatterHasTitle(
6796
+ params.frontMatterLines,
6797
+ params.config.front_matter_title
6798
+ );
6578
6799
  let hasTopLevelHeading = false;
6579
6800
  filterTokens(params, "heading_open", function forToken(token) {
6580
6801
  if (token.tag === tag) {
6581
6802
  if (hasTopLevelHeading || foundFrontMatterTitle) {
6582
- addErrorContext(onError, token.lineNumber, token.line.trim());
6803
+ addErrorContext(
6804
+ onError,
6805
+ token.lineNumber,
6806
+ token.line.trim()
6807
+ );
6583
6808
  } else if (token.lineNumber === 1) {
6584
6809
  hasTopLevelHeading = true;
6585
6810
  }
@@ -6602,7 +6827,9 @@ var require_md026 = __commonJS({
6602
6827
  "tags": ["headings", "headers"],
6603
6828
  "function": function MD026(params, onError) {
6604
6829
  let punctuation = params.config.punctuation;
6605
- punctuation = String(punctuation === void 0 ? allPunctuationNoQuestion : punctuation);
6830
+ punctuation = String(
6831
+ punctuation === void 0 ? allPunctuationNoQuestion : punctuation
6832
+ );
6606
6833
  const trailingPunctuationRe = new RegExp("\\s*[" + escapeForRegExp(punctuation) + "]+$");
6607
6834
  forEachHeading(params, (heading) => {
6608
6835
  const { line, lineNumber } = heading;
@@ -6612,10 +6839,17 @@ var require_md026 = __commonJS({
6612
6839
  const fullMatch = match[0];
6613
6840
  const column = match.index + 1;
6614
6841
  const length = fullMatch.length;
6615
- addError(onError, lineNumber, `Punctuation: '${fullMatch}'`, null, [column, length], {
6616
- "editColumn": column,
6617
- "deleteCount": length
6618
- });
6842
+ addError(
6843
+ onError,
6844
+ lineNumber,
6845
+ `Punctuation: '${fullMatch}'`,
6846
+ null,
6847
+ [column, length],
6848
+ {
6849
+ "editColumn": column,
6850
+ "deleteCount": length
6851
+ }
6852
+ );
6619
6853
  }
6620
6854
  });
6621
6855
  }
@@ -6658,10 +6892,18 @@ var require_md027 = __commonJS({
6658
6892
  { "length": spaceLength }
6659
6893
  ] = match;
6660
6894
  if (!listItemNesting || fullMatch[fullMatch.length - 1] === ">") {
6661
- addErrorContext(onError, lineNumber + i, line, null, null, [1, fullMatch.length], {
6662
- "editColumn": blockquoteLength + 1,
6663
- "deleteCount": spaceLength - 1
6664
- });
6895
+ addErrorContext(
6896
+ onError,
6897
+ lineNumber + i,
6898
+ line,
6899
+ null,
6900
+ null,
6901
+ [1, fullMatch.length],
6902
+ {
6903
+ "editColumn": blockquoteLength + 1,
6904
+ "deleteCount": spaceLength - 1
6905
+ }
6906
+ );
6665
6907
  }
6666
6908
  }
6667
6909
  }
@@ -6753,7 +6995,15 @@ var require_md029 = __commonJS({
6753
6995
  for (const item of items) {
6754
6996
  const match = orderedListItemMarkerRe.exec(item.line);
6755
6997
  if (match) {
6756
- addErrorDetailIf(onError, item.lineNumber, String(current), match[1], "Style: " + listStyleExamples[listStyle], null, rangeFromRegExp(item.line, listItemMarkerRe));
6998
+ addErrorDetailIf(
6999
+ onError,
7000
+ item.lineNumber,
7001
+ String(current),
7002
+ match[1],
7003
+ "Style: " + listStyleExamples[listStyle],
7004
+ null,
7005
+ rangeFromRegExp(item.line, listItemMarkerRe)
7006
+ );
6757
7007
  if (listStyle === "ordered") {
6758
7008
  current++;
6759
7009
  }
@@ -6797,7 +7047,16 @@ var require_md030 = __commonJS({
6797
7047
  "insertText": "".padEnd(expectedSpaces)
6798
7048
  };
6799
7049
  }
6800
- addErrorDetailIf(onError, lineNumber, expectedSpaces, actualSpaces, null, null, [1, matchLength], fixInfo);
7050
+ addErrorDetailIf(
7051
+ onError,
7052
+ lineNumber,
7053
+ expectedSpaces,
7054
+ actualSpaces,
7055
+ null,
7056
+ null,
7057
+ [1, matchLength],
7058
+ fixInfo
7059
+ );
6801
7060
  }
6802
7061
  }
6803
7062
  }
@@ -6831,7 +7090,15 @@ var require_md031 = __commonJS({
6831
7090
  "insertText": `${prefix.replace(/[^>]/g, " ").trim()}
6832
7091
  `
6833
7092
  };
6834
- addErrorContext(onError, i + 1, lines[i].trim(), null, null, null, fixInfo);
7093
+ addErrorContext(
7094
+ onError,
7095
+ i + 1,
7096
+ lines[i].trim(),
7097
+ null,
7098
+ null,
7099
+ null,
7100
+ fixInfo
7101
+ );
6835
7102
  }
6836
7103
  });
6837
7104
  }
@@ -6858,20 +7125,36 @@ var require_md032 = __commonJS({
6858
7125
  if (!isBlankLine(lines[firstIndex - 1])) {
6859
7126
  const line = lines[firstIndex];
6860
7127
  const quotePrefix = line.match(quotePrefixRe)[0].trimEnd();
6861
- addErrorContext(onError, firstIndex + 1, line.trim(), null, null, null, {
6862
- "insertText": `${quotePrefix}
7128
+ addErrorContext(
7129
+ onError,
7130
+ firstIndex + 1,
7131
+ line.trim(),
7132
+ null,
7133
+ null,
7134
+ null,
7135
+ {
7136
+ "insertText": `${quotePrefix}
6863
7137
  `
6864
- });
7138
+ }
7139
+ );
6865
7140
  }
6866
7141
  const lastIndex = list.lastLineIndex - 1;
6867
7142
  if (!isBlankLine(lines[lastIndex + 1])) {
6868
7143
  const line = lines[lastIndex];
6869
7144
  const quotePrefix = line.match(quotePrefixRe)[0].trimEnd();
6870
- addErrorContext(onError, lastIndex + 1, line.trim(), null, null, null, {
6871
- "lineNumber": lastIndex + 2,
6872
- "insertText": `${quotePrefix}
7145
+ addErrorContext(
7146
+ onError,
7147
+ lastIndex + 1,
7148
+ line.trim(),
7149
+ null,
7150
+ null,
7151
+ null,
7152
+ {
7153
+ "lineNumber": lastIndex + 2,
7154
+ "insertText": `${quotePrefix}
6873
7155
  `
6874
- });
7156
+ }
7157
+ );
6875
7158
  }
6876
7159
  }
6877
7160
  }
@@ -6911,7 +7194,13 @@ var require_md033 = __commonJS({
6911
7194
  if (!linkDestinationRe.test(prefix)) {
6912
7195
  const unescaped = unescapeMarkdown(prefix + "<", "_");
6913
7196
  if (!unescaped.endsWith("_")) {
6914
- addError(onError, lineIndex + 1, "Element: " + element, null, [match.index + 1, tag.length]);
7197
+ addError(
7198
+ onError,
7199
+ lineIndex + 1,
7200
+ "Element: " + element,
7201
+ null,
7202
+ [match.index + 1, tag.length]
7203
+ );
6915
7204
  }
6916
7205
  }
6917
7206
  }
@@ -6959,7 +7248,15 @@ var require_md034 = __commonJS({
6959
7248
  "deleteCount": range[1],
6960
7249
  "insertText": `<${bareUrl}>`
6961
7250
  } : null;
6962
- addErrorContext(onError, lineNumber, bareUrl, null, null, range, fixInfo);
7251
+ addErrorContext(
7252
+ onError,
7253
+ lineNumber,
7254
+ bareUrl,
7255
+ null,
7256
+ null,
7257
+ range,
7258
+ fixInfo
7259
+ );
6963
7260
  }
6964
7261
  }
6965
7262
  }
@@ -7018,7 +7315,11 @@ var require_md036 = __commonJS({
7018
7315
  return child.type !== "text" || child.content !== "";
7019
7316
  });
7020
7317
  if (children.length === 3 && (children[0].type === "strong_open" || children[0].type === "em_open") && children[1].type === "text" && !re.test(children[1].content)) {
7021
- addErrorContext(onError, t.lineNumber, children[1].content);
7318
+ addErrorContext(
7319
+ onError,
7320
+ t.lineNumber,
7321
+ children[1].content
7322
+ );
7022
7323
  }
7023
7324
  return base;
7024
7325
  };
@@ -7110,63 +7411,73 @@ var require_md037 = __commonJS({
7110
7411
  }
7111
7412
  const ignoreMarkersByLine = emphasisMarkersInContent(params);
7112
7413
  resetRunTracking();
7113
- forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence, inTable, inItem, onBreak, inMath) => {
7114
- const onItemStart = inItem === 1;
7115
- if (inCode || onFence || inTable || onBreak || onItemStart || isBlankLine(line)) {
7116
- resetRunTracking();
7117
- }
7118
- if (inCode || onFence || onBreak || inMath) {
7119
- return;
7120
- }
7121
- let patchedLine = line.replace(embeddedUnderscoreRe, "$1 $2");
7122
- if (onItemStart) {
7123
- patchedLine = patchedLine.replace(asteriskListItemMarkerRe, "$1 $2");
7124
- }
7125
- let match = null;
7126
- while (match = emphasisRe.exec(patchedLine)) {
7127
- const ignoreMarkersForLine = ignoreMarkersByLine[lineIndex];
7128
- const matchIndex = match.index + match[1].length;
7129
- if (ignoreMarkersForLine.includes(matchIndex)) {
7130
- continue;
7414
+ forEachLine(
7415
+ lineMetadata(),
7416
+ (line, lineIndex, inCode, onFence, inTable, inItem, onBreak, inMath) => {
7417
+ const onItemStart = inItem === 1;
7418
+ if (inCode || onFence || inTable || onBreak || onItemStart || isBlankLine(line)) {
7419
+ resetRunTracking();
7420
+ }
7421
+ if (inCode || onFence || onBreak || inMath) {
7422
+ return;
7131
7423
  }
7132
- const matchLength = match[0].length - match[1].length;
7133
- const matchKind = (match[2] || match[3])[0];
7134
- if (emphasisIndex === -1) {
7135
- emphasisIndex = matchIndex + matchLength;
7136
- emphasisLength = matchLength;
7137
- emphasisKind = matchKind;
7138
- effectiveEmphasisLength = matchLength;
7139
- } else if (matchKind === emphasisKind) {
7140
- if (matchLength === effectiveEmphasisLength) {
7141
- if (pendingError) {
7142
- addErrorContext(...pendingError);
7143
- pendingError = null;
7424
+ let patchedLine = line.replace(embeddedUnderscoreRe, "$1 $2");
7425
+ if (onItemStart) {
7426
+ patchedLine = patchedLine.replace(asteriskListItemMarkerRe, "$1 $2");
7427
+ }
7428
+ let match = null;
7429
+ while (match = emphasisRe.exec(patchedLine)) {
7430
+ const ignoreMarkersForLine = ignoreMarkersByLine[lineIndex];
7431
+ const matchIndex = match.index + match[1].length;
7432
+ if (ignoreMarkersForLine.includes(matchIndex)) {
7433
+ continue;
7434
+ }
7435
+ const matchLength = match[0].length - match[1].length;
7436
+ const matchKind = (match[2] || match[3])[0];
7437
+ if (emphasisIndex === -1) {
7438
+ emphasisIndex = matchIndex + matchLength;
7439
+ emphasisLength = matchLength;
7440
+ emphasisKind = matchKind;
7441
+ effectiveEmphasisLength = matchLength;
7442
+ } else if (matchKind === emphasisKind) {
7443
+ if (matchLength === effectiveEmphasisLength) {
7444
+ if (pendingError) {
7445
+ addErrorContext(...pendingError);
7446
+ pendingError = null;
7447
+ }
7448
+ const error = handleRunEnd(
7449
+ line,
7450
+ lineIndex,
7451
+ effectiveEmphasisLength,
7452
+ match,
7453
+ matchIndex,
7454
+ inTable
7455
+ );
7456
+ if (error) {
7457
+ addErrorContext(...error);
7458
+ }
7459
+ resetRunTracking();
7460
+ } else if (matchLength === 3) {
7461
+ effectiveEmphasisLength = matchLength - effectiveEmphasisLength;
7462
+ } else if (effectiveEmphasisLength === 3) {
7463
+ effectiveEmphasisLength -= matchLength;
7464
+ } else {
7465
+ effectiveEmphasisLength += matchLength;
7144
7466
  }
7145
- const error = handleRunEnd(line, lineIndex, effectiveEmphasisLength, match, matchIndex, inTable);
7146
- if (error) {
7147
- addErrorContext(...error);
7467
+ if (emphasisRe.lastIndex > 1) {
7468
+ emphasisRe.lastIndex--;
7148
7469
  }
7149
- resetRunTracking();
7150
- } else if (matchLength === 3) {
7151
- effectiveEmphasisLength = matchLength - effectiveEmphasisLength;
7152
- } else if (effectiveEmphasisLength === 3) {
7153
- effectiveEmphasisLength -= matchLength;
7154
- } else {
7155
- effectiveEmphasisLength += matchLength;
7156
- }
7157
- if (emphasisRe.lastIndex > 1) {
7470
+ } else if (emphasisRe.lastIndex > 1) {
7158
7471
  emphasisRe.lastIndex--;
7159
7472
  }
7160
- } else if (emphasisRe.lastIndex > 1) {
7161
- emphasisRe.lastIndex--;
7473
+ }
7474
+ if (emphasisIndex !== -1) {
7475
+ pendingError = pendingError || handleRunEnd(line, lineIndex, 0, null, line.length, inTable);
7476
+ emphasisIndex = 0;
7477
+ emphasisLength = 0;
7162
7478
  }
7163
7479
  }
7164
- if (emphasisIndex !== -1) {
7165
- pendingError = pendingError || handleRunEnd(line, lineIndex, 0, null, line.length, inTable);
7166
- emphasisIndex = 0;
7167
- emphasisLength = 0;
7168
- }
7169
- });
7480
+ );
7170
7481
  }
7171
7482
  };
7172
7483
  }
@@ -7188,36 +7499,47 @@ var require_md038 = __commonJS({
7188
7499
  filterTokens(params, "inline", (token) => {
7189
7500
  if (token.children.some(spaceInsideCodeInline)) {
7190
7501
  const tokenLines = params.lines.slice(token.map[0], token.map[1]);
7191
- forEachInlineCodeSpan(tokenLines.join("\n"), (code, lineIndex, columnIndex, tickCount) => {
7192
- let rangeIndex = columnIndex - tickCount;
7193
- let rangeLength = code.length + 2 * tickCount;
7194
- let rangeLineOffset = 0;
7195
- let fixIndex = columnIndex;
7196
- let fixLength = code.length;
7197
- const codeLines = code.split(newLineRe);
7198
- const left = leftSpaceRe.test(code);
7199
- const right = !left && rightSpaceRe.test(code);
7200
- if (right && codeLines.length > 1) {
7201
- rangeIndex = 0;
7202
- rangeLineOffset = codeLines.length - 1;
7203
- fixIndex = 0;
7204
- }
7205
- if (left || right) {
7206
- const codeLinesRange = codeLines[rangeLineOffset];
7207
- if (codeLines.length > 1) {
7208
- rangeLength = codeLinesRange.length + tickCount;
7209
- fixLength = codeLinesRange.length;
7502
+ forEachInlineCodeSpan(
7503
+ tokenLines.join("\n"),
7504
+ (code, lineIndex, columnIndex, tickCount) => {
7505
+ let rangeIndex = columnIndex - tickCount;
7506
+ let rangeLength = code.length + 2 * tickCount;
7507
+ let rangeLineOffset = 0;
7508
+ let fixIndex = columnIndex;
7509
+ let fixLength = code.length;
7510
+ const codeLines = code.split(newLineRe);
7511
+ const left = leftSpaceRe.test(code);
7512
+ const right = !left && rightSpaceRe.test(code);
7513
+ if (right && codeLines.length > 1) {
7514
+ rangeIndex = 0;
7515
+ rangeLineOffset = codeLines.length - 1;
7516
+ fixIndex = 0;
7517
+ }
7518
+ if (left || right) {
7519
+ const codeLinesRange = codeLines[rangeLineOffset];
7520
+ if (codeLines.length > 1) {
7521
+ rangeLength = codeLinesRange.length + tickCount;
7522
+ fixLength = codeLinesRange.length;
7523
+ }
7524
+ const context = tokenLines[lineIndex + rangeLineOffset].substring(rangeIndex, rangeIndex + rangeLength);
7525
+ const codeLinesRangeTrim = codeLinesRange.trim();
7526
+ const fixText = (codeLinesRangeTrim.startsWith("`") ? " " : "") + codeLinesRangeTrim + (codeLinesRangeTrim.endsWith("`") ? " " : "");
7527
+ addErrorContext(
7528
+ onError,
7529
+ token.lineNumber + lineIndex + rangeLineOffset,
7530
+ context,
7531
+ left,
7532
+ right,
7533
+ [rangeIndex + 1, rangeLength],
7534
+ {
7535
+ "editColumn": fixIndex + 1,
7536
+ "deleteCount": fixLength,
7537
+ "insertText": fixText
7538
+ }
7539
+ );
7210
7540
  }
7211
- const context = tokenLines[lineIndex + rangeLineOffset].substring(rangeIndex, rangeIndex + rangeLength);
7212
- const codeLinesRangeTrim = codeLinesRange.trim();
7213
- const fixText = (codeLinesRangeTrim.startsWith("`") ? " " : "") + codeLinesRangeTrim + (codeLinesRangeTrim.endsWith("`") ? " " : "");
7214
- addErrorContext(onError, token.lineNumber + lineIndex + rangeLineOffset, context, left, right, [rangeIndex + 1, rangeLength], {
7215
- "editColumn": fixIndex + 1,
7216
- "deleteCount": fixLength,
7217
- "insertText": fixText
7218
- });
7219
7541
  }
7220
- });
7542
+ );
7221
7543
  }
7222
7544
  });
7223
7545
  }
@@ -7267,7 +7589,15 @@ var require_md039 = __commonJS({
7267
7589
  };
7268
7590
  lineIndex = column + length - 1;
7269
7591
  }
7270
- addErrorContext(onError, lineNumber, `[${linkText}]`, left, right, range, fixInfo);
7592
+ addErrorContext(
7593
+ onError,
7594
+ lineNumber,
7595
+ `[${linkText}]`,
7596
+ left,
7597
+ right,
7598
+ range,
7599
+ fixInfo
7600
+ );
7271
7601
  }
7272
7602
  } else if (type2 === "softbreak" || type2 === "hardbreak") {
7273
7603
  lineNumber++;
@@ -7314,7 +7644,10 @@ var require_md041 = __commonJS({
7314
7644
  "function": function MD041(params, onError) {
7315
7645
  const level = Number(params.config.level || 1);
7316
7646
  const tag = "h" + level;
7317
- const foundFrontMatterTitle = frontMatterHasTitle(params.frontMatterLines, params.config.front_matter_title);
7647
+ const foundFrontMatterTitle = frontMatterHasTitle(
7648
+ params.frontMatterLines,
7649
+ params.config.front_matter_title
7650
+ );
7318
7651
  if (!foundFrontMatterTitle) {
7319
7652
  const htmlHeadingRe = new RegExp(`^<h${level}[ />]`, "i");
7320
7653
  params.tokens.every((token) => {
@@ -7367,12 +7700,21 @@ var require_md042 = __commonJS({
7367
7700
  if (emptyLink) {
7368
7701
  let context = `[${linkText}]`;
7369
7702
  let range = null;
7370
- const match = child.line.match(new RegExp(`${escapeForRegExp(context)}\\((?:|#|<>)\\)`));
7703
+ const match = child.line.match(
7704
+ new RegExp(`${escapeForRegExp(context)}\\((?:|#|<>)\\)`)
7705
+ );
7371
7706
  if (match) {
7372
7707
  context = match[0];
7373
7708
  range = [match.index + 1, match[0].length];
7374
7709
  }
7375
- addErrorContext(onError, child.lineNumber, context, null, null, range);
7710
+ addErrorContext(
7711
+ onError,
7712
+ child.lineNumber,
7713
+ context,
7714
+ null,
7715
+ null,
7716
+ range
7717
+ );
7376
7718
  emptyLink = false;
7377
7719
  }
7378
7720
  } else if (inLink) {
@@ -7424,14 +7766,23 @@ var require_md043 = __commonJS({
7424
7766
  } else if (matchAny) {
7425
7767
  i--;
7426
7768
  } else {
7427
- addErrorDetailIf(onError, heading.lineNumber, expected, actual);
7769
+ addErrorDetailIf(
7770
+ onError,
7771
+ heading.lineNumber,
7772
+ expected,
7773
+ actual
7774
+ );
7428
7775
  hasError = true;
7429
7776
  }
7430
7777
  }
7431
7778
  });
7432
7779
  const extraHeadings = requiredHeadings.length - i;
7433
7780
  if (!hasError && (extraHeadings > 1 || extraHeadings === 1 && requiredHeadings[i] !== "*") && (anyHeadings || !requiredHeadings.every((heading) => heading === "*"))) {
7434
- addErrorContext(onError, params.lines.length, requiredHeadings[i]);
7781
+ addErrorContext(
7782
+ onError,
7783
+ params.lines.length,
7784
+ requiredHeadings[i]
7785
+ );
7435
7786
  }
7436
7787
  }
7437
7788
  }
@@ -7476,7 +7827,9 @@ var require_md044 = __commonJS({
7476
7827
  }
7477
7828
  forEachLink(line, (index, _, text, destination) => {
7478
7829
  if (destination) {
7479
- exclusions.push([lineIndex, index + text.length, destination.length]);
7830
+ exclusions.push(
7831
+ [lineIndex, index + text.length, destination.length]
7832
+ );
7480
7833
  }
7481
7834
  });
7482
7835
  }
@@ -7501,11 +7854,20 @@ var require_md044 = __commonJS({
7501
7854
  const index = match.index + leftMatch.length;
7502
7855
  const length = nameMatch.length;
7503
7856
  if (!withinAnyRange(exclusions, lineIndex, index, length) && !names.includes(nameMatch)) {
7504
- addErrorDetailIf(onError, lineIndex + 1, name, nameMatch, null, null, [index + 1, length], {
7505
- "editColumn": index + 1,
7506
- "deleteCount": length,
7507
- "insertText": name
7508
- });
7857
+ addErrorDetailIf(
7858
+ onError,
7859
+ lineIndex + 1,
7860
+ name,
7861
+ nameMatch,
7862
+ null,
7863
+ null,
7864
+ [index + 1, length],
7865
+ {
7866
+ "editColumn": index + 1,
7867
+ "deleteCount": length,
7868
+ "insertText": name
7869
+ }
7870
+ );
7509
7871
  }
7510
7872
  exclusions.push([lineIndex, index, length]);
7511
7873
  }
@@ -7552,13 +7914,20 @@ var require_md046 = __commonJS({
7552
7914
  "tags": ["code"],
7553
7915
  "function": function MD046(params, onError) {
7554
7916
  let expectedStyle = String(params.config.style || "consistent");
7555
- const codeBlocksAndFences = params.tokens.filter((token) => token.type === "code_block" || token.type === "fence");
7917
+ const codeBlocksAndFences = params.tokens.filter(
7918
+ (token) => token.type === "code_block" || token.type === "fence"
7919
+ );
7556
7920
  for (const token of codeBlocksAndFences) {
7557
7921
  const { lineNumber, type: type2 } = token;
7558
7922
  if (expectedStyle === "consistent") {
7559
7923
  expectedStyle = tokenTypeToStyle[type2];
7560
7924
  }
7561
- addErrorDetailIf(onError, lineNumber, expectedStyle, tokenTypeToStyle[type2]);
7925
+ addErrorDetailIf(
7926
+ onError,
7927
+ lineNumber,
7928
+ expectedStyle,
7929
+ tokenTypeToStyle[type2]
7930
+ );
7562
7931
  }
7563
7932
  }
7564
7933
  };
@@ -7578,10 +7947,17 @@ var require_md047 = __commonJS({
7578
7947
  const lastLineNumber = params.lines.length;
7579
7948
  const lastLine = params.lines[lastLineNumber - 1];
7580
7949
  if (!isBlankLine(lastLine)) {
7581
- addError(onError, lastLineNumber, null, null, [lastLine.length, 1], {
7582
- "insertText": "\n",
7583
- "editColumn": lastLine.length + 1
7584
- });
7950
+ addError(
7951
+ onError,
7952
+ lastLineNumber,
7953
+ null,
7954
+ null,
7955
+ [lastLine.length, 1],
7956
+ {
7957
+ "insertText": "\n",
7958
+ "editColumn": lastLine.length + 1
7959
+ }
7960
+ );
7585
7961
  }
7586
7962
  }
7587
7963
  };
@@ -7606,7 +7982,12 @@ var require_md048 = __commonJS({
7606
7982
  if (expectedStyle === "consistent") {
7607
7983
  expectedStyle = fencedCodeBlockStyleFor(markup);
7608
7984
  }
7609
- addErrorDetailIf(onError, lineNumber, expectedStyle, fencedCodeBlockStyleFor(markup));
7985
+ addErrorDetailIf(
7986
+ onError,
7987
+ lineNumber,
7988
+ expectedStyle,
7989
+ fencedCodeBlockStyleFor(markup)
7990
+ );
7610
7991
  }
7611
7992
  }
7612
7993
  };
@@ -7635,7 +8016,12 @@ var require_md049_md050 = __commonJS({
7635
8016
  }
7636
8017
  if (style !== markupStyle) {
7637
8018
  let rangeAndFixInfo = {};
7638
- const contentToken = getNextChildToken(parent, token, "text", `${tagPrefix}_close`);
8019
+ const contentToken = getNextChildToken(
8020
+ parent,
8021
+ token,
8022
+ "text",
8023
+ `${tagPrefix}_close`
8024
+ );
7639
8025
  if (contentToken) {
7640
8026
  const { content } = contentToken;
7641
8027
  const actual = `${markup}${content}${markup}`;
@@ -7647,9 +8033,22 @@ var require_md049_md050 = __commonJS({
7647
8033
  }
7648
8034
  const instance = (instances.get(expected) || 0) + 1;
7649
8035
  instances.set(expected, instance);
7650
- rangeAndFixInfo = getRangeAndFixInfoIfFound(params.lines, lineNumber - 1, actual, expected, instance);
7651
- }
7652
- addError(onError, lineNumber, `Expected: ${style}; Actual: ${markupStyle}`, null, rangeAndFixInfo.range, rangeAndFixInfo.fixInfo);
8036
+ rangeAndFixInfo = getRangeAndFixInfoIfFound(
8037
+ params.lines,
8038
+ lineNumber - 1,
8039
+ actual,
8040
+ expected,
8041
+ instance
8042
+ );
8043
+ }
8044
+ addError(
8045
+ onError,
8046
+ lineNumber,
8047
+ `Expected: ${style}; Actual: ${markupStyle}`,
8048
+ null,
8049
+ rangeAndFixInfo.range,
8050
+ rangeAndFixInfo.fixInfo
8051
+ );
7653
8052
  }
7654
8053
  });
7655
8054
  };
@@ -7690,8 +8089,13 @@ var require_md051 = __commonJS({
7690
8089
  } = require_helpers2();
7691
8090
  var identifierRe = /(?:id|name)\s*=\s*['"]?([^'"\s>]+)/iu;
7692
8091
  function convertHeadingToHTMLFragment(inline) {
7693
- const inlineText = inline.children.map((token) => token.content).join("");
7694
- return "#" + encodeURIComponent(inlineText.toLowerCase().replace(/[^\p{Letter}\p{Mark}\p{Number}\p{Connector_Punctuation}\- ]/gu, "").replace(/ /gu, "-"));
8092
+ const inlineText = inline.children.filter((token) => token.type !== "html_inline").map((token) => token.content).join("");
8093
+ return "#" + encodeURIComponent(
8094
+ inlineText.toLowerCase().replace(
8095
+ /[^\p{Letter}\p{Mark}\p{Number}\p{Connector_Punctuation}\- ]/gu,
8096
+ ""
8097
+ ).replace(/ /gu, "-")
8098
+ );
7695
8099
  }
7696
8100
  module2.exports = {
7697
8101
  "names": ["MD051", "link-fragments"],
@@ -7728,12 +8132,14 @@ var require_md051 = __commonJS({
7728
8132
  if (id && id.length > 1 && id[0] === "#" && !fragments.has(id)) {
7729
8133
  let context = id;
7730
8134
  let range = null;
7731
- const match = line.match(new RegExp(`\\[.*?\\]\\(${escapeForRegExp(context)}\\)`));
8135
+ const match = line.match(
8136
+ new RegExp(`\\[.*?\\]\\(${escapeForRegExp(context)}\\)`)
8137
+ );
7732
8138
  if (match) {
7733
8139
  context = match[0];
7734
8140
  range = [match.index + 1, match[0].length];
7735
8141
  }
7736
- addError(onError, lineNumber, null, context, range);
8142
+ addError(onError, lineNumber, void 0, context, range);
7737
8143
  }
7738
8144
  });
7739
8145
  }
@@ -7760,7 +8166,13 @@ var require_md052 = __commonJS({
7760
8166
  for (const data of datas) {
7761
8167
  const [lineIndex, index, length] = data;
7762
8168
  const context = lines[lineIndex].slice(index, index + length);
7763
- addError(onError, lineIndex + 1, `Missing link or image reference definition: "${label}"`, context, [index + 1, context.length]);
8169
+ addError(
8170
+ onError,
8171
+ lineIndex + 1,
8172
+ `Missing link or image reference definition: "${label}"`,
8173
+ context,
8174
+ [index + 1, context.length]
8175
+ );
7764
8176
  }
7765
8177
  }
7766
8178
  }
@@ -7790,13 +8202,27 @@ var require_md053 = __commonJS({
7790
8202
  const [label, lineIndex] = definition;
7791
8203
  if (!references.has(label) && !shortcuts.has(label)) {
7792
8204
  const line = lines[lineIndex];
7793
- addError(onError, lineIndex + 1, `Unused link or image reference definition: "${label}"`, ellipsify(line), [1, line.length], singleLineDefinition(line) ? deleteFixInfo : 0);
8205
+ addError(
8206
+ onError,
8207
+ lineIndex + 1,
8208
+ `Unused link or image reference definition: "${label}"`,
8209
+ ellipsify(line),
8210
+ [1, line.length],
8211
+ singleLineDefinition(line) ? deleteFixInfo : 0
8212
+ );
7794
8213
  }
7795
8214
  }
7796
8215
  for (const duplicateDefinition of duplicateDefinitions) {
7797
8216
  const [label, lineIndex] = duplicateDefinition;
7798
8217
  const line = lines[lineIndex];
7799
- addError(onError, lineIndex + 1, `Duplicate link or image reference definition: "${label}"`, ellipsify(line), [1, line.length], singleLineDefinition(line) ? deleteFixInfo : 0);
8218
+ addError(
8219
+ onError,
8220
+ lineIndex + 1,
8221
+ `Duplicate link or image reference definition: "${label}"`,
8222
+ ellipsify(line),
8223
+ [1, line.length],
8224
+ singleLineDefinition(line) ? deleteFixInfo : 0
8225
+ );
7800
8226
  }
7801
8227
  }
7802
8228
  };
@@ -7807,7 +8233,7 @@ var require_md053 = __commonJS({
7807
8233
  var require_rules = __commonJS({
7808
8234
  "node_modules/markdownlint/lib/rules.js"(exports, module2) {
7809
8235
  "use strict";
7810
- var { URL: URL2 } = require("url");
8236
+ var URL2 = require("url").URL;
7811
8237
  var { homepage, version } = require_constants();
7812
8238
  var rules = [
7813
8239
  require_md001(),
@@ -7887,7 +8313,9 @@ var require_markdownlint = __commonJS({
7887
8313
  const allIds = {};
7888
8314
  for (const [index, rule] of ruleList.entries()) {
7889
8315
  let newError = function(property) {
7890
- return new Error("Property '" + property + "' of custom rule at index " + customIndex + " is incorrect.");
8316
+ return new Error(
8317
+ "Property '" + property + "' of custom rule at index " + customIndex + " is incorrect."
8318
+ );
7891
8319
  };
7892
8320
  const customIndex = index - rules.length;
7893
8321
  for (const property of ["names", "tags"]) {
@@ -7913,7 +8341,9 @@ var require_markdownlint = __commonJS({
7913
8341
  result = newError("asynchronous");
7914
8342
  }
7915
8343
  if (!result && rule.asynchronous && synchronous) {
7916
- result = new Error("Custom rule " + rule.names.join("/") + " at index " + customIndex + " is asynchronous and can not be used in a synchronous context.");
8344
+ result = new Error(
8345
+ "Custom rule " + rule.names.join("/") + " at index " + customIndex + " is asynchronous and can not be used in a synchronous context."
8346
+ );
7917
8347
  }
7918
8348
  if (!result) {
7919
8349
  for (const name of rule.names) {
@@ -7946,7 +8376,9 @@ var require_markdownlint = __commonJS({
7946
8376
  if (Array.isArray(fileResults)) {
7947
8377
  for (const result of fileResults) {
7948
8378
  const ruleMoniker = result.ruleNames ? result.ruleNames.join("/") : result.ruleName + "/" + result.ruleAlias;
7949
- results.push(file + ": " + result.lineNumber + ": " + ruleMoniker + " " + result.ruleDescription + (result.errorDetail ? " [" + result.errorDetail + "]" : "") + (result.errorContext ? ' [Context: "' + result.errorContext + '"]' : ""));
8379
+ results.push(
8380
+ file + ": " + result.lineNumber + ": " + ruleMoniker + " " + result.ruleDescription + (result.errorDetail ? " [" + result.errorDetail + "]" : "") + (result.errorContext ? ' [Context: "' + result.errorContext + '"]' : "")
8381
+ );
7950
8382
  }
7951
8383
  } else {
7952
8384
  if (!ruleNameToRule) {
@@ -8068,7 +8500,9 @@ var require_markdownlint = __commonJS({
8068
8500
  return aliasToRuleNames;
8069
8501
  }
8070
8502
  function getEffectiveConfig(ruleList, config2, aliasToRuleNames) {
8071
- const defaultKey = Object.keys(config2).filter((key) => key.toUpperCase() === "DEFAULT");
8503
+ const defaultKey = Object.keys(config2).filter(
8504
+ (key) => key.toUpperCase() === "DEFAULT"
8505
+ );
8072
8506
  const ruleDefault = defaultKey.length === 0 || !!config2[defaultKey[0]];
8073
8507
  const effectiveConfig = {};
8074
8508
  for (const rule of ruleList) {
@@ -8143,7 +8577,11 @@ var require_markdownlint = __commonJS({
8143
8577
  }
8144
8578
  function configureFile(action, parameter) {
8145
8579
  if (action === "CONFIGURE-FILE") {
8146
- const { "config": parsed } = parseConfiguration("CONFIGURE-FILE", parameter, configParsers);
8580
+ const { "config": parsed } = parseConfiguration(
8581
+ "CONFIGURE-FILE",
8582
+ parameter,
8583
+ configParsers
8584
+ );
8147
8585
  if (parsed) {
8148
8586
  config2 = {
8149
8587
  ...config2,
@@ -8186,11 +8624,19 @@ var require_markdownlint = __commonJS({
8186
8624
  const disableNextLine = action === "DISABLE-NEXT-LINE";
8187
8625
  if (disableLine || disableNextLine) {
8188
8626
  const nextLineNumber = frontMatterLines.length + lineNumber + (disableNextLine ? 1 : 0);
8189
- enabledRulesPerLineNumber[nextLineNumber] = applyEnableDisable(action, parameter, enabledRulesPerLineNumber[nextLineNumber] || {});
8627
+ enabledRulesPerLineNumber[nextLineNumber] = applyEnableDisable(
8628
+ action,
8629
+ parameter,
8630
+ enabledRulesPerLineNumber[nextLineNumber] || {}
8631
+ );
8190
8632
  }
8191
8633
  }
8192
8634
  handleInlineConfig([lines.join("\n")], configureFile);
8193
- const effectiveConfig = getEffectiveConfig(ruleList, config2, aliasToRuleNames);
8635
+ const effectiveConfig = getEffectiveConfig(
8636
+ ruleList,
8637
+ config2,
8638
+ aliasToRuleNames
8639
+ );
8194
8640
  for (const rule of ruleList) {
8195
8641
  const ruleName = rule.names[0].toUpperCase();
8196
8642
  allRuleNames.push(ruleName);
@@ -8210,7 +8656,15 @@ var require_markdownlint = __commonJS({
8210
8656
  const removeFrontMatterResult = removeFrontMatter(content, frontMatter);
8211
8657
  const { frontMatterLines } = removeFrontMatterResult;
8212
8658
  content = removeFrontMatterResult.content;
8213
- const { effectiveConfig, enabledRulesPerLineNumber } = getEnabledRulesPerLineNumber(ruleList, content.split(helpers.newLineRe), frontMatterLines, noInlineConfig, config2, configParsers, mapAliasToRuleNames(ruleList));
8659
+ const { effectiveConfig, enabledRulesPerLineNumber } = getEnabledRulesPerLineNumber(
8660
+ ruleList,
8661
+ content.split(helpers.newLineRe),
8662
+ frontMatterLines,
8663
+ noInlineConfig,
8664
+ config2,
8665
+ configParsers,
8666
+ mapAliasToRuleNames(ruleList)
8667
+ );
8214
8668
  content = helpers.clearHtmlCommentText(content);
8215
8669
  const tokens = md.parse(content, {});
8216
8670
  const lines = content.split(helpers.newLineRe);
@@ -8241,7 +8695,9 @@ var require_markdownlint = __commonJS({
8241
8695
  "config": effectiveConfig[ruleName]
8242
8696
  };
8243
8697
  function throwError2(property) {
8244
- throw new Error("Property '" + property + "' of onError parameter is incorrect.");
8698
+ throw new Error(
8699
+ "Property '" + property + "' of onError parameter is incorrect."
8700
+ );
8245
8701
  }
8246
8702
  function onError(errorInfo) {
8247
8703
  if (!errorInfo || !helpers.isNumber(errorInfo.lineNumber) || errorInfo.lineNumber < 1 || errorInfo.lineNumber > lines.length) {
@@ -8383,7 +8839,19 @@ var require_markdownlint = __commonJS({
8383
8839
  if (err) {
8384
8840
  return callback(err);
8385
8841
  }
8386
- return lintContent(ruleList, file, content, md, config2, configParsers, frontMatter, handleRuleFailures, noInlineConfig, resultVersion, callback);
8842
+ return lintContent(
8843
+ ruleList,
8844
+ file,
8845
+ content,
8846
+ md,
8847
+ config2,
8848
+ configParsers,
8849
+ frontMatter,
8850
+ handleRuleFailures,
8851
+ noInlineConfig,
8852
+ resultVersion,
8853
+ callback
8854
+ );
8387
8855
  }
8388
8856
  if (synchronous) {
8389
8857
  lintContentWrapper(null, fs2.readFileSync(file, "utf8"));
@@ -8442,10 +8910,35 @@ var require_markdownlint = __commonJS({
8442
8910
  } else if (files.length > 0) {
8443
8911
  concurrency++;
8444
8912
  currentItem = files.shift();
8445
- lintFile(ruleList, currentItem, md, config2, configParsers, frontMatter, handleRuleFailures, noInlineConfig, resultVersion, fs2, synchronous, lintWorkerCallback);
8913
+ lintFile(
8914
+ ruleList,
8915
+ currentItem,
8916
+ md,
8917
+ config2,
8918
+ configParsers,
8919
+ frontMatter,
8920
+ handleRuleFailures,
8921
+ noInlineConfig,
8922
+ resultVersion,
8923
+ fs2,
8924
+ synchronous,
8925
+ lintWorkerCallback
8926
+ );
8446
8927
  } else if (currentItem = stringsKeys.shift()) {
8447
8928
  concurrency++;
8448
- lintContent(ruleList, currentItem, strings[currentItem] || "", md, config2, configParsers, frontMatter, handleRuleFailures, noInlineConfig, resultVersion, lintWorkerCallback);
8929
+ lintContent(
8930
+ ruleList,
8931
+ currentItem,
8932
+ strings[currentItem] || "",
8933
+ md,
8934
+ config2,
8935
+ configParsers,
8936
+ frontMatter,
8937
+ handleRuleFailures,
8938
+ noInlineConfig,
8939
+ resultVersion,
8940
+ lintWorkerCallback
8941
+ );
8449
8942
  } else if (concurrency === 0) {
8450
8943
  done = true;
8451
8944
  return callback(null, results);
@@ -8490,7 +8983,10 @@ var require_markdownlint = __commonJS({
8490
8983
  fs2.access(resolvedExtendsFile, (err) => {
8491
8984
  if (err) {
8492
8985
  try {
8493
- return callback(null, dynamicRequire.resolve(referenceId, { "paths": [configFileDirname] }));
8986
+ return callback(null, dynamicRequire.resolve(
8987
+ referenceId,
8988
+ { "paths": [configFileDirname] }
8989
+ ));
8494
8990
  } catch {
8495
8991
  }
8496
8992
  }
@@ -8506,7 +9002,10 @@ var require_markdownlint = __commonJS({
8506
9002
  } catch {
8507
9003
  }
8508
9004
  try {
8509
- return dynamicRequire.resolve(referenceId, { "paths": [configFileDirname] });
9005
+ return dynamicRequire.resolve(
9006
+ referenceId,
9007
+ { "paths": [configFileDirname] }
9008
+ );
8510
9009
  } catch {
8511
9010
  }
8512
9011
  return resolvedExtendsFile;
@@ -8537,15 +9036,25 @@ var require_markdownlint = __commonJS({
8537
9036
  const configExtends = config2.extends;
8538
9037
  if (configExtends) {
8539
9038
  delete config2.extends;
8540
- return resolveConfigExtends(file, helpers.expandTildePath(configExtends, os), fs2, (_, resolvedExtends) => readConfig(resolvedExtends, parsers, fs2, (errr, extendsConfig) => {
8541
- if (errr) {
8542
- return callback(errr);
8543
- }
8544
- return callback(null, {
8545
- ...extendsConfig,
8546
- ...config2
8547
- });
8548
- }));
9039
+ return resolveConfigExtends(
9040
+ file,
9041
+ helpers.expandTildePath(configExtends, os),
9042
+ fs2,
9043
+ (_, resolvedExtends) => readConfig(
9044
+ resolvedExtends,
9045
+ parsers,
9046
+ fs2,
9047
+ (errr, extendsConfig) => {
9048
+ if (errr) {
9049
+ return callback(errr);
9050
+ }
9051
+ return callback(null, {
9052
+ ...extendsConfig,
9053
+ ...config2
9054
+ });
9055
+ }
9056
+ )
9057
+ );
8549
9058
  }
8550
9059
  return callback(null, config2);
8551
9060
  });
@@ -8568,7 +9077,11 @@ var require_markdownlint = __commonJS({
8568
9077
  const configExtends = config2.extends;
8569
9078
  if (configExtends) {
8570
9079
  delete config2.extends;
8571
- const resolvedExtends = resolveConfigExtendsSync(file, helpers.expandTildePath(configExtends, os), fs2);
9080
+ const resolvedExtends = resolveConfigExtendsSync(
9081
+ file,
9082
+ helpers.expandTildePath(configExtends, os),
9083
+ fs2
9084
+ );
8572
9085
  return {
8573
9086
  ...readConfigSync2(resolvedExtends, parsers, fs2),
8574
9087
  ...config2
@@ -8756,7 +9269,9 @@ var require_helpers3 = __commonJS({
8756
9269
  }
8757
9270
  module2.exports.isMathBlock = isMathBlock;
8758
9271
  module2.exports.getLineMetadata = function getLineMetadata(params) {
8759
- const lineMetadata = params.lines.map((line, index) => [line, index, false, 0, false, false, false, false]);
9272
+ const lineMetadata = params.lines.map(
9273
+ (line, index) => [line, index, false, 0, false, false, false, false]
9274
+ );
8760
9275
  filterTokens(params, "fence", (token) => {
8761
9276
  lineMetadata[token.map[0]][3] = 1;
8762
9277
  lineMetadata[token.map[1] - 1][3] = -1;
@@ -8889,7 +9404,12 @@ var require_helpers3 = __commonJS({
8889
9404
  lineStartIndex = newLineIndex + 1;
8890
9405
  }
8891
9406
  const columnIndex = startIndex - lineStartIndex + startLength;
8892
- handler(input.slice(startIndex + startLength, endIndex), lineIndex, columnIndex, startLength);
9407
+ handler(
9408
+ input.slice(startIndex + startLength, endIndex),
9409
+ lineIndex,
9410
+ columnIndex,
9411
+ startLength
9412
+ );
8893
9413
  i = j;
8894
9414
  break;
8895
9415
  }
@@ -8922,7 +9442,14 @@ var require_helpers3 = __commonJS({
8922
9442
  module2.exports.addError = addError;
8923
9443
  module2.exports.addErrorDetailIf = function addErrorDetailIf(onError, lineNumber, expected, actual, detail, context, range, fixInfo) {
8924
9444
  if (expected !== actual) {
8925
- addError(onError, lineNumber, "Expected: " + expected + "; Actual: " + actual + (detail ? "; " + detail : ""), context, range, fixInfo);
9445
+ addError(
9446
+ onError,
9447
+ lineNumber,
9448
+ "Expected: " + expected + "; Actual: " + actual + (detail ? "; " + detail : ""),
9449
+ context,
9450
+ range,
9451
+ fixInfo
9452
+ );
8926
9453
  }
8927
9454
  };
8928
9455
  module2.exports.addErrorContext = function addErrorContext(onError, lineNumber, context, left, right, range, fixInfo) {
@@ -8939,16 +9466,19 @@ var require_helpers3 = __commonJS({
8939
9466
  filterTokens(params, "inline", (token) => {
8940
9467
  if (token.children.some((child) => child.type === "code_inline")) {
8941
9468
  const tokenLines = params.lines.slice(token.map[0], token.map[1]);
8942
- forEachInlineCodeSpan(tokenLines.join("\n"), (code, lineIndex, columnIndex) => {
8943
- const codeLines = code.split(newLineRe);
8944
- for (const [i, line] of codeLines.entries()) {
8945
- exclusions.push([
8946
- token.lineNumber - 1 + lineIndex + i,
8947
- i ? 0 : columnIndex,
8948
- line.length
8949
- ]);
9469
+ forEachInlineCodeSpan(
9470
+ tokenLines.join("\n"),
9471
+ (code, lineIndex, columnIndex) => {
9472
+ const codeLines = code.split(newLineRe);
9473
+ for (const [i, line] of codeLines.entries()) {
9474
+ exclusions.push([
9475
+ token.lineNumber - 1 + lineIndex + i,
9476
+ i ? 0 : columnIndex,
9477
+ line.length
9478
+ ]);
9479
+ }
8950
9480
  }
8951
- });
9481
+ );
8952
9482
  }
8953
9483
  });
8954
9484
  return exclusions;
@@ -8977,7 +9507,10 @@ var require_helpers3 = __commonJS({
8977
9507
  };
8978
9508
  module2.exports.frontMatterHasTitle = function frontMatterHasTitle(frontMatterLines, frontMatterTitlePattern) {
8979
9509
  const ignoreFrontMatter = frontMatterTitlePattern !== void 0 && !frontMatterTitlePattern;
8980
- const frontMatterTitleRe = new RegExp(String(frontMatterTitlePattern || '^\\s*"?title"?\\s*[:=]'), "i");
9510
+ const frontMatterTitleRe = new RegExp(
9511
+ String(frontMatterTitlePattern || '^\\s*"?title"?\\s*[:=]'),
9512
+ "i"
9513
+ );
8981
9514
  return !ignoreFrontMatter && frontMatterLines.some((line) => frontMatterTitleRe.test(line));
8982
9515
  };
8983
9516
  function forEachLink(line, handler) {
@@ -9057,19 +9590,22 @@ var require_helpers3 = __commonJS({
9057
9590
  const { children, lineNumber, map: map2 } = token;
9058
9591
  if (children.some((child) => child.type === "code_inline")) {
9059
9592
  const tokenLines = lines.slice(map2[0], map2[1]);
9060
- forEachInlineCodeSpan(tokenLines.join("\n"), (code, lineIndex, column, tickCount) => {
9061
- const codeLines = code.split(newLineRe);
9062
- for (const [codeLineIndex, codeLine] of codeLines.entries()) {
9063
- const byLineIndex = lineNumber - 1 + lineIndex + codeLineIndex;
9064
- const inLine = byLine[byLineIndex];
9065
- const codeLineOffset = codeLineIndex ? 0 : column - 1 + tickCount;
9066
- let match = null;
9067
- while (match = emphasisMarkersRe.exec(codeLine)) {
9068
- inLine.push(codeLineOffset + match.index);
9593
+ forEachInlineCodeSpan(
9594
+ tokenLines.join("\n"),
9595
+ (code, lineIndex, column, tickCount) => {
9596
+ const codeLines = code.split(newLineRe);
9597
+ for (const [codeLineIndex, codeLine] of codeLines.entries()) {
9598
+ const byLineIndex = lineNumber - 1 + lineIndex + codeLineIndex;
9599
+ const inLine = byLine[byLineIndex];
9600
+ const codeLineOffset = codeLineIndex ? 0 : column - 1 + tickCount;
9601
+ let match = null;
9602
+ while (match = emphasisMarkersRe.exec(codeLine)) {
9603
+ inLine.push(codeLineOffset + match.index);
9604
+ }
9605
+ byLine[byLineIndex] = inLine;
9069
9606
  }
9070
- byLine[byLineIndex] = inLine;
9071
9607
  }
9072
- });
9608
+ );
9073
9609
  }
9074
9610
  });
9075
9611
  return byLine;
@@ -9082,7 +9618,12 @@ var require_helpers3 = __commonJS({
9082
9618
  const duplicateDefinitions = [];
9083
9619
  const normalizeLabel = (s) => s.toLowerCase().trim().replace(/\s+/g, " ");
9084
9620
  const exclusions = [];
9085
- const excluded = (match) => withinAnyRange(exclusions, 0, match.index, match[0].length);
9621
+ const excluded = (match) => withinAnyRange(
9622
+ exclusions,
9623
+ 0,
9624
+ match.index,
9625
+ match[0].length
9626
+ );
9086
9627
  const lineOffsets = [];
9087
9628
  let currentOffset = 0;
9088
9629
  const contentLines = [];
@@ -9133,7 +9674,9 @@ var require_helpers3 = __commonJS({
9133
9674
  if (!matchString.startsWith("\\") && !matchString.startsWith("!\\") && !matchText.endsWith("\\") && !(matchLabel || "").endsWith("\\") && (topLevel || matchString.startsWith("!")) && !excluded(referenceLinkMatch)) {
9134
9675
  const shortcutLink = matchLabel === void 0;
9135
9676
  const collapsedLink = !shortcutLink && matchLabel.length === 0;
9136
- const label = normalizeLabel(shortcutLink || collapsedLink ? matchText : matchLabel);
9677
+ const label = normalizeLabel(
9678
+ shortcutLink || collapsedLink ? matchText : matchLabel
9679
+ );
9137
9680
  if (label.length > 0) {
9138
9681
  if (shortcutLink) {
9139
9682
  shortcuts.add(label);
@@ -9155,12 +9698,14 @@ var require_helpers3 = __commonJS({
9155
9698
  ]);
9156
9699
  references.set(label, referenceData);
9157
9700
  if (!matchString.startsWith("!")) {
9158
- pendingContents.push({
9159
- "content": matchText,
9160
- "contentLineIndex": lineIndex,
9161
- "contentIndex": referenceIndex + 1,
9162
- "topLevel": false
9163
- });
9701
+ pendingContents.push(
9702
+ {
9703
+ "content": matchText,
9704
+ "contentLineIndex": lineIndex,
9705
+ "contentIndex": referenceIndex + 1,
9706
+ "topLevel": false
9707
+ }
9708
+ );
9164
9709
  }
9165
9710
  }
9166
9711
  }
@@ -9294,7 +9839,7 @@ var require_helpers3 = __commonJS({
9294
9839
  }
9295
9840
  module2.exports.getNextChildToken = getNextChildToken;
9296
9841
  function expandTildePath(file, os) {
9297
- const homedir = os && os.homedir();
9842
+ const homedir = os && os.homedir && os.homedir();
9298
9843
  return homedir ? file.replace(/^~($|\/|\\)/, `${homedir}$1`) : file;
9299
9844
  }
9300
9845
  module2.exports.expandTildePath = expandTildePath;
@@ -9548,7 +10093,7 @@ var require_utils2 = __commonJS({
9548
10093
  return arg != null;
9549
10094
  });
9550
10095
  for (var i in args)
9551
- if (typeof args[i] !== "string")
10096
+ if ("string" !== typeof args[i])
9552
10097
  return;
9553
10098
  var file2 = path2.join.apply(null, args);
9554
10099
  var content;
@@ -9760,7 +10305,9 @@ var require_minimist = __commonJS({
9760
10305
  }
9761
10306
  } else {
9762
10307
  if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
9763
- argv._.push(flags.strings["_"] || !isNumber(arg) ? arg : Number(arg));
10308
+ argv._.push(
10309
+ flags.strings["_"] || !isNumber(arg) ? arg : Number(arg)
10310
+ );
9764
10311
  }
9765
10312
  if (opts.stopEarly) {
9766
10313
  argv._.push.apply(argv._, args.slice(i + 1));
@@ -9819,11 +10366,11 @@ var require_rc = __commonJS({
9819
10366
  var win = process.platform === "win32";
9820
10367
  var home = win ? process.env.USERPROFILE : process.env.HOME;
9821
10368
  module2.exports = function(name, defaults, argv, parse) {
9822
- if (typeof name !== "string")
10369
+ if ("string" !== typeof name)
9823
10370
  throw new Error("rc(name): name *must* be string");
9824
10371
  if (!argv)
9825
10372
  argv = require_minimist()(process.argv.slice(2));
9826
- defaults = (typeof defaults === "string" ? cc.json(defaults) : defaults) || {};
10373
+ defaults = ("string" === typeof defaults ? cc.json(defaults) : defaults) || {};
9827
10374
  parse = parse || cc.parse;
9828
10375
  var env = cc.env(name + "_");
9829
10376
  var configs = [defaults];
@@ -10008,7 +10555,13 @@ function makeSnippet(mark, options) {
10008
10555
  for (i = 1; i <= options.linesBefore; i++) {
10009
10556
  if (foundLineNo - i < 0)
10010
10557
  break;
10011
- line = getLine(mark.buffer, lineStarts[foundLineNo - i], lineEnds[foundLineNo - i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), maxLineLength);
10558
+ line = getLine(
10559
+ mark.buffer,
10560
+ lineStarts[foundLineNo - i],
10561
+ lineEnds[foundLineNo - i],
10562
+ mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),
10563
+ maxLineLength
10564
+ );
10012
10565
  result = common.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result;
10013
10566
  }
10014
10567
  line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
@@ -10017,7 +10570,13 @@ function makeSnippet(mark, options) {
10017
10570
  for (i = 1; i <= options.linesAfter; i++) {
10018
10571
  if (foundLineNo + i >= lineEnds.length)
10019
10572
  break;
10020
- line = getLine(mark.buffer, lineStarts[foundLineNo + i], lineEnds[foundLineNo + i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), maxLineLength);
10573
+ line = getLine(
10574
+ mark.buffer,
10575
+ lineStarts[foundLineNo + i],
10576
+ lineEnds[foundLineNo + i],
10577
+ mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),
10578
+ maxLineLength
10579
+ );
10021
10580
  result += common.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line.str + "\n";
10022
10581
  }
10023
10582
  return result.replace(/\n$/, "");
@@ -10381,7 +10940,9 @@ var int = new type("tag:yaml.org,2002:int", {
10381
10940
  hexadecimal: [16, "hex"]
10382
10941
  }
10383
10942
  });
10384
- var YAML_FLOAT_PATTERN = new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
10943
+ var YAML_FLOAT_PATTERN = new RegExp(
10944
+ "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
10945
+ );
10385
10946
  function resolveYamlFloat(data) {
10386
10947
  if (data === null)
10387
10948
  return false;
@@ -10460,8 +11021,12 @@ var json = failsafe.extend({
10460
11021
  ]
10461
11022
  });
10462
11023
  var core = json;
10463
- var YAML_DATE_REGEXP = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$");
10464
- var YAML_TIMESTAMP_REGEXP = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");
11024
+ var YAML_DATE_REGEXP = new RegExp(
11025
+ "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
11026
+ );
11027
+ var YAML_TIMESTAMP_REGEXP = new RegExp(
11028
+ "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
11029
+ );
10465
11030
  function resolveYamlTimestamp(data) {
10466
11031
  if (data === null)
10467
11032
  return false;
@@ -10768,7 +11333,10 @@ function charFromCodepoint(c) {
10768
11333
  if (c <= 65535) {
10769
11334
  return String.fromCharCode(c);
10770
11335
  }
10771
- return String.fromCharCode((c - 65536 >> 10) + 55296, (c - 65536 & 1023) + 56320);
11336
+ return String.fromCharCode(
11337
+ (c - 65536 >> 10) + 55296,
11338
+ (c - 65536 & 1023) + 56320
11339
+ );
10772
11340
  }
10773
11341
  var simpleEscapeCheck = new Array(256);
10774
11342
  var simpleEscapeMap = new Array(256);
@@ -12118,7 +12686,16 @@ function writeScalar(state, string, level, iskey, inblock) {
12118
12686
  function testAmbiguity(string2) {
12119
12687
  return testImplicitResolving(state, string2);
12120
12688
  }
12121
- switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {
12689
+ switch (chooseScalarStyle(
12690
+ string,
12691
+ singleLineOnly,
12692
+ state.indent,
12693
+ lineWidth,
12694
+ testAmbiguity,
12695
+ state.quotingType,
12696
+ state.forceQuotes && !iskey,
12697
+ inblock
12698
+ )) {
12122
12699
  case STYLE_PLAIN:
12123
12700
  return string;
12124
12701
  case STYLE_SINGLE:
@@ -12415,7 +12992,9 @@ function writeNode(state, level, object, block, compact, iskey, isblockseq) {
12415
12992
  throw new exception("unacceptable kind of an object to dump " + type2);
12416
12993
  }
12417
12994
  if (state.tag !== null && state.tag !== "?") {
12418
- tagStr = encodeURI(state.tag[0] === "!" ? state.tag.slice(1) : state.tag).replace(/!/g, "%21");
12995
+ tagStr = encodeURI(
12996
+ state.tag[0] === "!" ? state.tag.slice(1) : state.tag
12997
+ ).replace(/!/g, "%21");
12419
12998
  if (state.tag[0] === "!") {
12420
12999
  tagStr = "!" + tagStr;
12421
13000
  } else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") {
@@ -12747,10 +13326,16 @@ async function didSaveTextDocument(document) {
12747
13326
  }
12748
13327
  async function activate(context) {
12749
13328
  await engine.parseConfig();
12750
- context.subscriptions.push(import_coc2.languages.registerCodeActionProvider(documentSelector, engine, "markdownlint"), import_coc2.commands.registerCommand(engine.fixAllCommandName, async () => {
12751
- const { document } = await import_coc2.workspace.getCurrentState();
12752
- engine.fixAll(document);
12753
- }), import_coc2.workspace.onDidOpenTextDocument(didOpenTextDocument), import_coc2.workspace.onDidChangeTextDocument(didChangeTextDocument), import_coc2.workspace.onDidSaveTextDocument(didSaveTextDocument));
13329
+ context.subscriptions.push(
13330
+ import_coc2.languages.registerCodeActionProvider(documentSelector, engine, "markdownlint"),
13331
+ import_coc2.commands.registerCommand(engine.fixAllCommandName, async () => {
13332
+ const { document } = await import_coc2.workspace.getCurrentState();
13333
+ engine.fixAll(document);
13334
+ }),
13335
+ import_coc2.workspace.onDidOpenTextDocument(didOpenTextDocument),
13336
+ import_coc2.workspace.onDidChangeTextDocument(didChangeTextDocument),
13337
+ import_coc2.workspace.onDidSaveTextDocument(didSaveTextDocument)
13338
+ );
12754
13339
  import_coc2.workspace.documents.map((doc) => {
12755
13340
  didOpenTextDocument(doc.textDocument);
12756
13341
  });