coc-markdownlint 1.30.0 → 1.32.0

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
@@ -624,10 +624,10 @@ var require_utils = __commonJS({
624
624
  var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g;
625
625
  var ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi;
626
626
  var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + "|" + ENTITY_RE.source, "gi");
627
- var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;
627
+ var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;
628
628
  var entities = require_entities2();
629
629
  function replaceEntityPattern(match, name) {
630
- var code = 0;
630
+ var code;
631
631
  if (has(entities, name)) {
632
632
  return entities[name];
633
633
  }
@@ -818,8 +818,8 @@ var require_parse_link_destination = __commonJS({
818
818
  "node_modules/markdown-it/lib/helpers/parse_link_destination.js"(exports, module2) {
819
819
  "use strict";
820
820
  var unescapeAll = require_utils().unescapeAll;
821
- module2.exports = function parseLinkDestination(str2, pos, max) {
822
- var code, level, lines = 0, start = pos, result = {
821
+ module2.exports = function parseLinkDestination(str2, start, max) {
822
+ var code, level, pos = start, result = {
823
823
  ok: false,
824
824
  pos: 0,
825
825
  lines: 0,
@@ -886,7 +886,6 @@ var require_parse_link_destination = __commonJS({
886
886
  return result;
887
887
  }
888
888
  result.str = unescapeAll(str2.slice(start, pos));
889
- result.lines = lines;
890
889
  result.pos = pos;
891
890
  result.ok = true;
892
891
  return result;
@@ -899,8 +898,8 @@ var require_parse_link_title = __commonJS({
899
898
  "node_modules/markdown-it/lib/helpers/parse_link_title.js"(exports, module2) {
900
899
  "use strict";
901
900
  var unescapeAll = require_utils().unescapeAll;
902
- module2.exports = function parseLinkTitle(str2, pos, max) {
903
- var code, marker, lines = 0, start = pos, result = {
901
+ module2.exports = function parseLinkTitle(str2, start, max) {
902
+ var code, marker, lines = 0, pos = start, result = {
904
903
  ok: false,
905
904
  pos: 0,
906
905
  lines: 0,
@@ -962,7 +961,7 @@ var require_renderer = __commonJS({
962
961
  var default_rules = {};
963
962
  default_rules.code_inline = function(tokens, idx, options, env, slf) {
964
963
  var token = tokens[idx];
965
- return "<code" + slf.renderAttrs(token) + ">" + escapeHtml(tokens[idx].content) + "</code>";
964
+ return "<code" + slf.renderAttrs(token) + ">" + escapeHtml(token.content) + "</code>";
966
965
  };
967
966
  default_rules.code_block = function(tokens, idx, options, env, slf) {
968
967
  var token = tokens[idx];
@@ -1094,7 +1093,7 @@ var require_renderer = __commonJS({
1094
1093
  if (type2 === "inline") {
1095
1094
  result += this.renderInline(tokens[i].children, options, env);
1096
1095
  } else if (typeof rules[type2] !== "undefined") {
1097
- result += rules[tokens[i].type](tokens, i, options, env, this);
1096
+ result += rules[type2](tokens, i, options, env, this);
1098
1097
  } else {
1099
1098
  result += this.renderToken(tokens, i, options, env);
1100
1099
  }
@@ -2084,58 +2083,20 @@ var require_blockquote = __commonJS({
2084
2083
  if (state.sCount[startLine] - state.blkIndent >= 4) {
2085
2084
  return false;
2086
2085
  }
2087
- if (state.src.charCodeAt(pos++) !== 62) {
2086
+ if (state.src.charCodeAt(pos) !== 62) {
2088
2087
  return false;
2089
2088
  }
2090
2089
  if (silent) {
2091
2090
  return true;
2092
2091
  }
2093
- initial = offset = state.sCount[startLine] + 1;
2094
- if (state.src.charCodeAt(pos) === 32) {
2095
- pos++;
2096
- initial++;
2097
- offset++;
2098
- adjustTab = false;
2099
- spaceAfterMarker = true;
2100
- } else if (state.src.charCodeAt(pos) === 9) {
2101
- spaceAfterMarker = true;
2102
- if ((state.bsCount[startLine] + offset) % 4 === 3) {
2103
- pos++;
2104
- initial++;
2105
- offset++;
2106
- adjustTab = false;
2107
- } else {
2108
- adjustTab = true;
2109
- }
2110
- } else {
2111
- spaceAfterMarker = false;
2112
- }
2113
- oldBMarks = [state.bMarks[startLine]];
2114
- state.bMarks[startLine] = pos;
2115
- while (pos < max) {
2116
- ch = state.src.charCodeAt(pos);
2117
- if (isSpace(ch)) {
2118
- if (ch === 9) {
2119
- offset += 4 - (offset + state.bsCount[startLine] + (adjustTab ? 1 : 0)) % 4;
2120
- } else {
2121
- offset++;
2122
- }
2123
- } else {
2124
- break;
2125
- }
2126
- pos++;
2127
- }
2128
- oldBSCount = [state.bsCount[startLine]];
2129
- state.bsCount[startLine] = state.sCount[startLine] + 1 + (spaceAfterMarker ? 1 : 0);
2130
- lastLineEmpty = pos >= max;
2131
- oldSCount = [state.sCount[startLine]];
2132
- state.sCount[startLine] = offset - initial;
2133
- oldTShift = [state.tShift[startLine]];
2134
- state.tShift[startLine] = pos - state.bMarks[startLine];
2092
+ oldBMarks = [];
2093
+ oldBSCount = [];
2094
+ oldSCount = [];
2095
+ oldTShift = [];
2135
2096
  terminatorRules = state.md.block.ruler.getRules("blockquote");
2136
2097
  oldParentType = state.parentType;
2137
2098
  state.parentType = "blockquote";
2138
- for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {
2099
+ for (nextLine = startLine; nextLine < endLine; nextLine++) {
2139
2100
  isOutdented = state.sCount[nextLine] < state.blkIndent;
2140
2101
  pos = state.bMarks[nextLine] + state.tShift[nextLine];
2141
2102
  max = state.eMarks[nextLine];
@@ -2143,19 +2104,17 @@ var require_blockquote = __commonJS({
2143
2104
  break;
2144
2105
  }
2145
2106
  if (state.src.charCodeAt(pos++) === 62 && !isOutdented) {
2146
- initial = offset = state.sCount[nextLine] + 1;
2107
+ initial = state.sCount[nextLine] + 1;
2147
2108
  if (state.src.charCodeAt(pos) === 32) {
2148
2109
  pos++;
2149
2110
  initial++;
2150
- offset++;
2151
2111
  adjustTab = false;
2152
2112
  spaceAfterMarker = true;
2153
2113
  } else if (state.src.charCodeAt(pos) === 9) {
2154
2114
  spaceAfterMarker = true;
2155
- if ((state.bsCount[nextLine] + offset) % 4 === 3) {
2115
+ if ((state.bsCount[nextLine] + initial) % 4 === 3) {
2156
2116
  pos++;
2157
2117
  initial++;
2158
- offset++;
2159
2118
  adjustTab = false;
2160
2119
  } else {
2161
2120
  adjustTab = true;
@@ -2163,6 +2122,7 @@ var require_blockquote = __commonJS({
2163
2122
  } else {
2164
2123
  spaceAfterMarker = false;
2165
2124
  }
2125
+ offset = initial;
2166
2126
  oldBMarks.push(state.bMarks[nextLine]);
2167
2127
  state.bMarks[nextLine] = pos;
2168
2128
  while (pos < max) {
@@ -2341,37 +2301,37 @@ var require_list = __commonJS({
2341
2301
  }
2342
2302
  }
2343
2303
  module2.exports = function list(state, startLine, endLine, silent) {
2344
- var ch, contentStart, i, indent, indentAfterMarker, initial, isOrdered, itemLines, l, listLines, listTokIdx, markerCharCode, markerValue, max, nextLine, offset, oldListIndent, oldParentType, oldSCount, oldTShift, oldTight, pos, posAfterMarker, prevEmptyEnd, start, terminate, terminatorRules, token, isTerminatingParagraph = false, tight = true;
2345
- if (state.sCount[startLine] - state.blkIndent >= 4) {
2304
+ var ch, contentStart, i, indent, indentAfterMarker, initial, isOrdered, itemLines, l, listLines, listTokIdx, markerCharCode, markerValue, max, offset, oldListIndent, oldParentType, oldSCount, oldTShift, oldTight, pos, posAfterMarker, prevEmptyEnd, start, terminate, terminatorRules, token, nextLine = startLine, isTerminatingParagraph = false, tight = true;
2305
+ if (state.sCount[nextLine] - state.blkIndent >= 4) {
2346
2306
  return false;
2347
2307
  }
2348
- if (state.listIndent >= 0 && state.sCount[startLine] - state.listIndent >= 4 && state.sCount[startLine] < state.blkIndent) {
2308
+ if (state.listIndent >= 0 && state.sCount[nextLine] - state.listIndent >= 4 && state.sCount[nextLine] < state.blkIndent) {
2349
2309
  return false;
2350
2310
  }
2351
2311
  if (silent && state.parentType === "paragraph") {
2352
- if (state.sCount[startLine] >= state.blkIndent) {
2312
+ if (state.sCount[nextLine] >= state.blkIndent) {
2353
2313
  isTerminatingParagraph = true;
2354
2314
  }
2355
2315
  }
2356
- if ((posAfterMarker = skipOrderedListMarker(state, startLine)) >= 0) {
2316
+ if ((posAfterMarker = skipOrderedListMarker(state, nextLine)) >= 0) {
2357
2317
  isOrdered = true;
2358
- start = state.bMarks[startLine] + state.tShift[startLine];
2318
+ start = state.bMarks[nextLine] + state.tShift[nextLine];
2359
2319
  markerValue = Number(state.src.slice(start, posAfterMarker - 1));
2360
2320
  if (isTerminatingParagraph && markerValue !== 1)
2361
2321
  return false;
2362
- } else if ((posAfterMarker = skipBulletListMarker(state, startLine)) >= 0) {
2322
+ } else if ((posAfterMarker = skipBulletListMarker(state, nextLine)) >= 0) {
2363
2323
  isOrdered = false;
2364
2324
  } else {
2365
2325
  return false;
2366
2326
  }
2367
2327
  if (isTerminatingParagraph) {
2368
- if (state.skipSpaces(posAfterMarker) >= state.eMarks[startLine])
2328
+ if (state.skipSpaces(posAfterMarker) >= state.eMarks[nextLine])
2369
2329
  return false;
2370
2330
  }
2371
- markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
2372
2331
  if (silent) {
2373
2332
  return true;
2374
2333
  }
2334
+ markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
2375
2335
  listTokIdx = state.tokens.length;
2376
2336
  if (isOrdered) {
2377
2337
  token = state.push("ordered_list_open", "ol", 1);
@@ -2381,9 +2341,8 @@ var require_list = __commonJS({
2381
2341
  } else {
2382
2342
  token = state.push("bullet_list_open", "ul", 1);
2383
2343
  }
2384
- token.map = listLines = [startLine, 0];
2344
+ token.map = listLines = [nextLine, 0];
2385
2345
  token.markup = String.fromCharCode(markerCharCode);
2386
- nextLine = startLine;
2387
2346
  prevEmptyEnd = false;
2388
2347
  terminatorRules = state.md.block.ruler.getRules("list");
2389
2348
  oldParentType = state.parentType;
@@ -2391,7 +2350,7 @@ var require_list = __commonJS({
2391
2350
  while (nextLine < endLine) {
2392
2351
  pos = posAfterMarker;
2393
2352
  max = state.eMarks[nextLine];
2394
- initial = offset = state.sCount[nextLine] + posAfterMarker - (state.bMarks[startLine] + state.tShift[startLine]);
2353
+ initial = offset = state.sCount[nextLine] + posAfterMarker - (state.bMarks[nextLine] + state.tShift[nextLine]);
2395
2354
  while (pos < max) {
2396
2355
  ch = state.src.charCodeAt(pos);
2397
2356
  if (ch === 9) {
@@ -2415,45 +2374,44 @@ var require_list = __commonJS({
2415
2374
  indent = initial + indentAfterMarker;
2416
2375
  token = state.push("list_item_open", "li", 1);
2417
2376
  token.markup = String.fromCharCode(markerCharCode);
2418
- token.map = itemLines = [startLine, 0];
2377
+ token.map = itemLines = [nextLine, 0];
2419
2378
  if (isOrdered) {
2420
2379
  token.info = state.src.slice(start, posAfterMarker - 1);
2421
2380
  }
2422
2381
  oldTight = state.tight;
2423
- oldTShift = state.tShift[startLine];
2424
- oldSCount = state.sCount[startLine];
2382
+ oldTShift = state.tShift[nextLine];
2383
+ oldSCount = state.sCount[nextLine];
2425
2384
  oldListIndent = state.listIndent;
2426
2385
  state.listIndent = state.blkIndent;
2427
2386
  state.blkIndent = indent;
2428
2387
  state.tight = true;
2429
- state.tShift[startLine] = contentStart - state.bMarks[startLine];
2430
- state.sCount[startLine] = offset;
2431
- if (contentStart >= max && state.isEmpty(startLine + 1)) {
2388
+ state.tShift[nextLine] = contentStart - state.bMarks[nextLine];
2389
+ state.sCount[nextLine] = offset;
2390
+ if (contentStart >= max && state.isEmpty(nextLine + 1)) {
2432
2391
  state.line = Math.min(state.line + 2, endLine);
2433
2392
  } else {
2434
- state.md.block.tokenize(state, startLine, endLine, true);
2393
+ state.md.block.tokenize(state, nextLine, endLine, true);
2435
2394
  }
2436
2395
  if (!state.tight || prevEmptyEnd) {
2437
2396
  tight = false;
2438
2397
  }
2439
- prevEmptyEnd = state.line - startLine > 1 && state.isEmpty(state.line - 1);
2398
+ prevEmptyEnd = state.line - nextLine > 1 && state.isEmpty(state.line - 1);
2440
2399
  state.blkIndent = state.listIndent;
2441
2400
  state.listIndent = oldListIndent;
2442
- state.tShift[startLine] = oldTShift;
2443
- state.sCount[startLine] = oldSCount;
2401
+ state.tShift[nextLine] = oldTShift;
2402
+ state.sCount[nextLine] = oldSCount;
2444
2403
  state.tight = oldTight;
2445
2404
  token = state.push("list_item_close", "li", -1);
2446
2405
  token.markup = String.fromCharCode(markerCharCode);
2447
- nextLine = startLine = state.line;
2406
+ nextLine = state.line;
2448
2407
  itemLines[1] = nextLine;
2449
- contentStart = state.bMarks[startLine];
2450
2408
  if (nextLine >= endLine) {
2451
2409
  break;
2452
2410
  }
2453
2411
  if (state.sCount[nextLine] < state.blkIndent) {
2454
2412
  break;
2455
2413
  }
2456
- if (state.sCount[startLine] - state.blkIndent >= 4) {
2414
+ if (state.sCount[nextLine] - state.blkIndent >= 4) {
2457
2415
  break;
2458
2416
  }
2459
2417
  terminate = false;
@@ -2924,8 +2882,8 @@ var require_lheading = __commonJS({
2924
2882
  var require_paragraph = __commonJS({
2925
2883
  "node_modules/markdown-it/lib/rules_block/paragraph.js"(exports, module2) {
2926
2884
  "use strict";
2927
- module2.exports = function paragraph(state, startLine) {
2928
- var content, terminate, i, l, token, oldParentType, nextLine = startLine + 1, terminatorRules = state.md.block.ruler.getRules("paragraph"), endLine = state.lineMax;
2885
+ module2.exports = function paragraph(state, startLine, endLine) {
2886
+ var content, terminate, i, l, token, oldParentType, nextLine = startLine + 1, terminatorRules = state.md.block.ruler.getRules("paragraph");
2929
2887
  oldParentType = state.parentType;
2930
2888
  state.parentType = "paragraph";
2931
2889
  for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
@@ -3157,7 +3115,7 @@ var require_parser_block = __commonJS({
3157
3115
  }
3158
3116
  }
3159
3117
  ParserBlock.prototype.tokenize = function(state, startLine, endLine) {
3160
- var ok, i, rules = this.ruler.getRules(""), len = rules.length, line = startLine, hasEmptyLines = false, maxNesting = state.md.options.maxNesting;
3118
+ var ok, i, prevLine, rules = this.ruler.getRules(""), len = rules.length, line = startLine, hasEmptyLines = false, maxNesting = state.md.options.maxNesting;
3161
3119
  while (line < endLine) {
3162
3120
  state.line = line = state.skipEmptyLines(line);
3163
3121
  if (line >= endLine) {
@@ -3170,12 +3128,18 @@ var require_parser_block = __commonJS({
3170
3128
  state.line = endLine;
3171
3129
  break;
3172
3130
  }
3131
+ prevLine = state.line;
3173
3132
  for (i = 0; i < len; i++) {
3174
3133
  ok = rules[i](state, line, endLine, false);
3175
3134
  if (ok) {
3135
+ if (prevLine >= state.line) {
3136
+ throw new Error("block rule didn't increment state.line");
3137
+ }
3176
3138
  break;
3177
3139
  }
3178
3140
  }
3141
+ if (!ok)
3142
+ throw new Error("none of the block rules matched");
3179
3143
  state.tight = !hasEmptyLines;
3180
3144
  if (state.isEmpty(state.line - 1)) {
3181
3145
  hasEmptyLines = true;
@@ -3281,6 +3245,8 @@ var require_linkify2 = __commonJS({
3281
3245
  if (!link)
3282
3246
  return false;
3283
3247
  url = link.url;
3248
+ if (url.length <= proto.length)
3249
+ return false;
3284
3250
  url = url.replace(/\*+$/, "");
3285
3251
  fullUrl = state.md.normalizeLink(url);
3286
3252
  if (!state.md.validateLink(fullUrl))
@@ -3424,7 +3390,7 @@ var require_backticks = __commonJS({
3424
3390
  state.pos += openerLength;
3425
3391
  return true;
3426
3392
  }
3427
- matchStart = matchEnd = pos;
3393
+ matchEnd = pos;
3428
3394
  while ((matchStart = state.src.indexOf("`", matchEnd)) !== -1) {
3429
3395
  matchEnd = matchStart + 1;
3430
3396
  while (matchEnd < max && state.src.charCodeAt(matchEnd) === 96) {
@@ -3952,7 +3918,7 @@ var require_html_inline = __commonJS({
3952
3918
  }
3953
3919
  if (!silent) {
3954
3920
  token = state.push("html_inline", "", 0);
3955
- token.content = state.src.slice(pos, pos + match[0].length);
3921
+ token.content = match[0];
3956
3922
  if (isLinkOpen(token.content))
3957
3923
  state.linkLevel++;
3958
3924
  if (isLinkClose(token.content))
@@ -4018,7 +3984,7 @@ var require_entity = __commonJS({
4018
3984
  var require_balance_pairs = __commonJS({
4019
3985
  "node_modules/markdown-it/lib/rules_inline/balance_pairs.js"(exports, module2) {
4020
3986
  "use strict";
4021
- function processDelimiters(state, delimiters) {
3987
+ function processDelimiters(delimiters) {
4022
3988
  var closerIdx, openerIdx, closer, opener, minOpenerIdx, newMinOpenerIdx, isOddMatch, lastJump, openersBottom = {}, max = delimiters.length;
4023
3989
  if (!max)
4024
3990
  return;
@@ -4074,10 +4040,10 @@ var require_balance_pairs = __commonJS({
4074
4040
  }
4075
4041
  module2.exports = function link_pairs(state) {
4076
4042
  var curr, tokens_meta = state.tokens_meta, max = state.tokens_meta.length;
4077
- processDelimiters(state, state.delimiters);
4043
+ processDelimiters(state.delimiters);
4078
4044
  for (curr = 0; curr < max; curr++) {
4079
4045
  if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
4080
- processDelimiters(state, tokens_meta[curr].delimiters);
4046
+ processDelimiters(tokens_meta[curr].delimiters);
4081
4047
  }
4082
4048
  }
4083
4049
  };
@@ -4262,6 +4228,9 @@ var require_parser_inline = __commonJS({
4262
4228
  ok = rules[i](state, true);
4263
4229
  state.level--;
4264
4230
  if (ok) {
4231
+ if (pos >= state.pos) {
4232
+ throw new Error("inline rule didn't increment state.pos");
4233
+ }
4265
4234
  break;
4266
4235
  }
4267
4236
  }
@@ -4274,12 +4243,16 @@ var require_parser_inline = __commonJS({
4274
4243
  cache[pos] = state.pos;
4275
4244
  };
4276
4245
  ParserInline.prototype.tokenize = function(state) {
4277
- var ok, i, rules = this.ruler.getRules(""), len = rules.length, end = state.posMax, maxNesting = state.md.options.maxNesting;
4246
+ var ok, i, prevPos, rules = this.ruler.getRules(""), len = rules.length, end = state.posMax, maxNesting = state.md.options.maxNesting;
4278
4247
  while (state.pos < end) {
4248
+ prevPos = state.pos;
4279
4249
  if (state.level < maxNesting) {
4280
4250
  for (i = 0; i < len; i++) {
4281
4251
  ok = rules[i](state, false);
4282
4252
  if (ok) {
4253
+ if (prevPos >= state.pos) {
4254
+ throw new Error("inline rule didn't increment state.pos");
4255
+ }
4283
4256
  break;
4284
4257
  }
4285
4258
  }
@@ -5097,7 +5070,7 @@ var require_micromark = __commonJS({
5097
5070
  e.r(t), e.d(t, { gfmAutolinkLiteral: () => D, gfmFootnote: () => P, gfmTable: () => Q, math: () => re, parse: () => vt, postprocess: () => yt, preprocess: () => qt });
5098
5071
  var n = {};
5099
5072
  e.r(n), e.d(n, { attentionMarkers: () => xt, contentInitial: () => pt, disable: () => kt, document: () => ft, flow: () => mt, flowInitial: () => dt, insideSpan: () => bt, string: () => gt, text: () => ht });
5100
- const r = h(/\p{P}/u), i = h(/[A-Za-z]/), o = h(/[\dA-Za-z]/), c = h(/[#-'*+\--9=?A-Z^-~]/);
5073
+ const r = h(new RegExp("\\p{P}", "u")), i = h(/[A-Za-z]/), o = h(/[\dA-Za-z]/), c = h(/[#-'*+\--9=?A-Z^-~]/);
5101
5074
  function u(e2) {
5102
5075
  return null !== e2 && (e2 < 32 || 127 === e2);
5103
5076
  }
@@ -6925,6 +6898,7 @@ var require_shared = __commonJS({
6925
6898
  "node_modules/markdownlint/helpers/shared.js"(exports, module2) {
6926
6899
  "use strict";
6927
6900
  module2.exports.newLineRe = /\r\n?|\n/g;
6901
+ module2.exports.nextLinesRe = /[\r\n][\s\S]*$/;
6928
6902
  }
6929
6903
  });
6930
6904
 
@@ -6943,6 +6917,15 @@ var require_micromark2 = __commonJS({
6943
6917
  // @ts-ignore
6944
6918
  } = require_micromark();
6945
6919
  var { newLineRe } = require_shared();
6920
+ var flatTokensSymbol = Symbol("flat-tokens");
6921
+ function isHtmlFlowComment(token) {
6922
+ const { text, type: type2 } = token;
6923
+ if (type2 === "htmlFlow" && text.startsWith("<!--") && text.endsWith("-->")) {
6924
+ const comment = text.slice(4, -3);
6925
+ return !comment.startsWith(">") && !comment.startsWith("->") && !comment.endsWith("-");
6926
+ }
6927
+ return false;
6928
+ }
6946
6929
  function getMicromarkEvents(markdown, micromarkOptions = {}, referencesDefined = true) {
6947
6930
  micromarkOptions.extensions = micromarkOptions.extensions || [];
6948
6931
  micromarkOptions.extensions.push(
@@ -6961,26 +6944,36 @@ var require_micromark2 = __commonJS({
6961
6944
  const events = postprocess(parseContext.document().write(chunks));
6962
6945
  return events;
6963
6946
  }
6964
- function micromarkParseWithOffset(markdown, micromarkOptions, referencesDefined, lineDelta) {
6947
+ function micromarkParseWithOffset(markdown, micromarkOptions, referencesDefined, lineDelta, ancestor) {
6965
6948
  const events = getMicromarkEvents(
6966
6949
  markdown,
6967
6950
  micromarkOptions,
6968
6951
  referencesDefined
6969
6952
  );
6970
6953
  const document = [];
6971
- let current = {
6972
- "children": document
6954
+ let flatTokens = [];
6955
+ const root = {
6956
+ "type": "ROOT",
6957
+ "startLine": -1,
6958
+ "startColumn": -1,
6959
+ "endLine": -1,
6960
+ "endColumn": -1,
6961
+ "text": "ROOT",
6962
+ "children": document,
6963
+ "parent": null
6973
6964
  };
6974
- const history = [current];
6965
+ const history = [root];
6966
+ let current = root;
6975
6967
  let reparseOptions = null;
6976
6968
  let lines = null;
6969
+ let skipHtmlFlowChildren = false;
6977
6970
  for (const event of events) {
6978
6971
  const [kind, token, context] = event;
6979
6972
  const { type: type2, start, end } = token;
6980
6973
  const { "column": startColumn, "line": startLine } = start;
6981
6974
  const { "column": endColumn, "line": endLine } = end;
6982
6975
  const text = context.sliceSerialize(token);
6983
- if (kind === "enter") {
6976
+ if (kind === "enter" && !skipHtmlFlowChildren) {
6984
6977
  const previous = current;
6985
6978
  history.push(previous);
6986
6979
  current = {
@@ -6990,9 +6983,13 @@ var require_micromark2 = __commonJS({
6990
6983
  "endLine": endLine + lineDelta,
6991
6984
  endColumn,
6992
6985
  text,
6993
- "children": []
6986
+ "children": [],
6987
+ "parent": previous === root ? ancestor || null : previous
6994
6988
  };
6995
- if (current.type === "htmlFlow") {
6989
+ previous.children.push(current);
6990
+ flatTokens.push(current);
6991
+ if (current.type === "htmlFlow" && !isHtmlFlowComment(current)) {
6992
+ skipHtmlFlowChildren = true;
6996
6993
  if (!reparseOptions || !lines) {
6997
6994
  reparseOptions = {
6998
6995
  ...micromarkOptions,
@@ -7007,20 +7004,28 @@ var require_micromark2 = __commonJS({
7007
7004
  lines = markdown.split(newLineRe);
7008
7005
  }
7009
7006
  const reparseMarkdown = lines.slice(current.startLine - 1, current.endLine).join("\n");
7010
- current.htmlFlowChildren = micromarkParseWithOffset(
7007
+ const tokens = micromarkParseWithOffset(
7011
7008
  reparseMarkdown,
7012
7009
  reparseOptions,
7013
7010
  referencesDefined,
7014
- current.startLine - 1
7011
+ current.startLine - 1,
7012
+ current
7015
7013
  );
7014
+ current.children = tokens;
7015
+ flatTokens = flatTokens.concat(tokens[flatTokensSymbol]);
7016
7016
  }
7017
- previous.children.push(current);
7018
7017
  } else if (kind === "exit") {
7019
- Object.freeze(current.children);
7020
- Object.freeze(current);
7021
- current = history.pop();
7018
+ if (type2 === "htmlFlow") {
7019
+ skipHtmlFlowChildren = false;
7020
+ }
7021
+ if (!skipHtmlFlowChildren) {
7022
+ Object.freeze(current.children);
7023
+ Object.freeze(current);
7024
+ current = history.pop();
7025
+ }
7022
7026
  }
7023
7027
  }
7028
+ Object.defineProperty(document, flatTokensSymbol, { "value": flatTokens });
7024
7029
  Object.freeze(document);
7025
7030
  return document;
7026
7031
  }
@@ -7033,50 +7038,45 @@ var require_micromark2 = __commonJS({
7033
7038
  );
7034
7039
  }
7035
7040
  function filterByPredicate(tokens, allowed, transformChildren) {
7041
+ allowed = allowed || (() => true);
7036
7042
  const result = [];
7037
- const pending = [...tokens];
7038
- let token = null;
7039
- while (token = pending.shift()) {
7040
- if (allowed(token)) {
7041
- result.push(token);
7042
- }
7043
- if (token.children.length > 0) {
7044
- const transformed = transformChildren ? transformChildren(token) : token.children;
7045
- pending.unshift(...transformed);
7043
+ const queue = [
7044
+ {
7045
+ "array": tokens,
7046
+ "index": 0
7046
7047
  }
7047
- }
7048
- return result;
7049
- }
7050
- function filterByTypes(tokens, allowed) {
7051
- return filterByPredicate(
7052
- tokens,
7053
- (token) => allowed.includes(token.type)
7054
- );
7055
- }
7056
- function filterByHtmlTokens(tokens) {
7057
- const result = [];
7058
- const pending = [tokens];
7059
- let current = null;
7060
- while (current = pending.shift()) {
7061
- for (const token of filterByTypes(current, ["htmlFlow", "htmlText"])) {
7062
- if (token.type === "htmlText") {
7048
+ ];
7049
+ while (queue.length > 0) {
7050
+ const current = queue[queue.length - 1];
7051
+ const { array, index } = current;
7052
+ if (index < array.length) {
7053
+ const token = array[current.index++];
7054
+ if (allowed(token)) {
7063
7055
  result.push(token);
7064
- } else {
7065
- pending.push(token.htmlFlowChildren);
7066
7056
  }
7057
+ const { children } = token;
7058
+ if (children.length > 0) {
7059
+ const transformed = transformChildren ? transformChildren(token) : children;
7060
+ queue.push(
7061
+ {
7062
+ "array": transformed,
7063
+ "index": 0
7064
+ }
7065
+ );
7066
+ }
7067
+ } else {
7068
+ queue.pop();
7067
7069
  }
7068
7070
  }
7069
7071
  return result;
7070
7072
  }
7071
- function flattenedChildren(parent) {
7072
- const result = [];
7073
- const pending = [...parent.children];
7074
- let token = null;
7075
- while (token = pending.shift()) {
7076
- result.push(token);
7077
- pending.unshift(...token.children);
7073
+ function filterByTypes(tokens, types2) {
7074
+ const predicate = (token) => types2.includes(token.type);
7075
+ const flatTokens = tokens[flatTokensSymbol];
7076
+ if (flatTokens) {
7077
+ return flatTokens.filter(predicate);
7078
7078
  }
7079
- return result;
7079
+ return filterByPredicate(tokens, predicate);
7080
7080
  }
7081
7081
  function getHeadingLevel(heading) {
7082
7082
  const headingSequence = filterByTypes(
@@ -7107,9 +7107,18 @@ var require_micromark2 = __commonJS({
7107
7107
  }
7108
7108
  return null;
7109
7109
  }
7110
+ function getTokenParentOfType(token, types2) {
7111
+ let current = token;
7112
+ while ((current = current.parent) && !types2.includes(current.type)) {
7113
+ }
7114
+ return current;
7115
+ }
7110
7116
  function getTokenTextByType(tokens, type2) {
7111
7117
  const filtered = tokens.filter((token) => token.type === type2);
7112
- return filtered.length === 1 ? filtered[0].text : null;
7118
+ return filtered.length > 0 ? filtered[0].text : null;
7119
+ }
7120
+ function inHtmlFlow(token) {
7121
+ return getTokenParentOfType(token, ["htmlFlow"]) !== null;
7113
7122
  }
7114
7123
  function matchAndGetTokensByType(tokens, matchTypes, resultTypes) {
7115
7124
  if (tokens.length !== matchTypes.length) {
@@ -7131,14 +7140,14 @@ var require_micromark2 = __commonJS({
7131
7140
  }
7132
7141
  module2.exports = {
7133
7142
  "parse": micromarkParse,
7134
- filterByHtmlTokens,
7135
7143
  filterByPredicate,
7136
7144
  filterByTypes,
7137
- flattenedChildren,
7138
7145
  getHeadingLevel,
7139
7146
  getHtmlTagInfo,
7140
7147
  getMicromarkEvents,
7148
+ getTokenParentOfType,
7141
7149
  getTokenTextByType,
7150
+ inHtmlFlow,
7142
7151
  matchAndGetTokensByType,
7143
7152
  tokenIfType
7144
7153
  };
@@ -7149,11 +7158,10 @@ var require_micromark2 = __commonJS({
7149
7158
  var require_constants = __commonJS({
7150
7159
  "node_modules/markdownlint/lib/constants.js"(exports, module2) {
7151
7160
  "use strict";
7152
- module2.exports.deprecatedRuleNames = ["MD002", "MD006"];
7161
+ module2.exports.deprecatedRuleNames = [];
7153
7162
  module2.exports.fixableRuleNames = [
7154
7163
  "MD004",
7155
7164
  "MD005",
7156
- "MD006",
7157
7165
  "MD007",
7158
7166
  "MD009",
7159
7167
  "MD010",
@@ -7180,10 +7188,11 @@ var require_constants = __commonJS({
7180
7188
  "MD049",
7181
7189
  "MD050",
7182
7190
  "MD051",
7183
- "MD053"
7191
+ "MD053",
7192
+ "MD054"
7184
7193
  ];
7185
7194
  module2.exports.homepage = "https://github.com/DavidAnson/markdownlint";
7186
- module2.exports.version = "0.30.0";
7195
+ module2.exports.version = "0.32.0";
7187
7196
  }
7188
7197
  });
7189
7198
 
@@ -7192,14 +7201,11 @@ var require_helpers2 = __commonJS({
7192
7201
  "node_modules/markdownlint/helpers/helpers.js"(exports, module2) {
7193
7202
  "use strict";
7194
7203
  var micromark = require_micromark2();
7195
- var { newLineRe } = require_shared();
7204
+ var { newLineRe, nextLinesRe } = require_shared();
7196
7205
  module2.exports.newLineRe = newLineRe;
7197
- module2.exports.frontMatterRe = // eslint-disable-next-line max-len
7198
- /((^---\s*$[\s\S]*?^---\s*)|(^\+\+\+\s*$[\s\S]*?^(\+\+\+|\.\.\.)\s*)|(^\{\s*$[\s\S]*?^\}\s*))(\r\n|\r|\n|$)/m;
7199
- var inlineCommentStartRe = (
7200
- // eslint-disable-next-line max-len
7201
- /(<!--\s*markdownlint-(disable|enable|capture|restore|disable-file|enable-file|disable-line|disable-next-line|configure-file))(?:\s|-->)/gi
7202
- );
7206
+ module2.exports.nextLinesRe = nextLinesRe;
7207
+ module2.exports.frontMatterRe = /((^---\s*$[\s\S]+?^---\s*)|(^\+\+\+\s*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{\s*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m;
7208
+ var inlineCommentStartRe = /(<!--\s*markdownlint-(disable|enable|capture|restore|disable-file|enable-file|disable-line|disable-next-line|configure-file))(?:\s|-->)/gi;
7203
7209
  module2.exports.inlineCommentStartRe = inlineCommentStartRe;
7204
7210
  module2.exports.listItemMarkerRe = /^([\s>]*)(?:[*+-]|\d+[.)])\s+/;
7205
7211
  module2.exports.orderedListItemMarkerRe = /^[\s>]*0*(\d+)[.)]/;
@@ -7207,10 +7213,8 @@ var require_helpers2 = __commonJS({
7207
7213
  module2.exports.blockquotePrefixRe = blockquotePrefixRe;
7208
7214
  var linkReferenceDefinitionRe = /^ {0,3}\[([^\]]*[^\\])\]:/;
7209
7215
  module2.exports.linkReferenceDefinitionRe = linkReferenceDefinitionRe;
7210
- module2.exports.endOfLineHtmlEntityRe = // eslint-disable-next-line max-len
7211
- /&(?:#\d+|#[xX][\da-fA-F]+|[a-zA-Z]{2,31}|blk\d{2}|emsp1[34]|frac\d{2}|sup\d|there4);$/;
7212
- module2.exports.endOfLineGemojiCodeRe = // eslint-disable-next-line max-len
7213
- /:(?:[abmovx]|[-+]1|100|1234|(?:1st|2nd|3rd)_place_medal|8ball|clock\d{1,4}|e-mail|non-potable_water|o2|t-rex|u5272|u5408|u55b6|u6307|u6708|u6709|u6e80|u7121|u7533|u7981|u7a7a|[a-z]{2,15}2?|[a-z]{1,14}(?:_[a-z\d]{1,16})+):$/;
7216
+ module2.exports.endOfLineHtmlEntityRe = /&(?:#\d+|#[xX][\da-fA-F]+|[a-zA-Z]{2,31}|blk\d{2}|emsp1[34]|frac\d{2}|sup\d|there4);$/;
7217
+ module2.exports.endOfLineGemojiCodeRe = /:(?:[abmovx]|[-+]1|100|1234|(?:1st|2nd|3rd)_place_medal|8ball|clock\d{1,4}|e-mail|non-potable_water|o2|t-rex|u5272|u5408|u55b6|u6307|u6708|u6709|u6e80|u7121|u7533|u7981|u7a7a|[a-z]{2,15}2?|[a-z]{1,14}(?:_[a-z\d]{1,16})+):$/;
7214
7218
  var allPunctuation = ".,;:!?\u3002\uFF0C\uFF1B\uFF1A\uFF01\uFF1F";
7215
7219
  module2.exports.allPunctuation = allPunctuation;
7216
7220
  module2.exports.allPunctuationNoQuestion = allPunctuation.replace(/[??]/gu, "");
@@ -7242,6 +7246,9 @@ var require_helpers2 = __commonJS({
7242
7246
  return isUrl(url) ? new URL(url) : url;
7243
7247
  }
7244
7248
  module2.exports.cloneIfUrl = cloneIfUrl;
7249
+ module2.exports.getHtmlAttributeRe = function getHtmlAttributeRe(name) {
7250
+ return new RegExp(`\\s${name}\\s*=\\s*['"]?([^'"\\s>]*)`, "iu");
7251
+ };
7245
7252
  function isBlankLine(line) {
7246
7253
  const startComment = "<!--";
7247
7254
  const endComment = "-->";
@@ -7364,7 +7371,7 @@ var require_helpers2 = __commonJS({
7364
7371
  }
7365
7372
  }
7366
7373
  module2.exports.filterTokens = filterTokens;
7367
- module2.exports.getLineMetadata = function getLineMetadata(params) {
7374
+ function getLineMetadata(params) {
7368
7375
  const lineMetadata = params.lines.map(
7369
7376
  (line, index) => [line, index, false, 0, false, false, false]
7370
7377
  );
@@ -7396,7 +7403,8 @@ var require_helpers2 = __commonJS({
7396
7403
  lineMetadata[token.map[0]][6] = true;
7397
7404
  });
7398
7405
  return lineMetadata;
7399
- };
7406
+ }
7407
+ module2.exports.getLineMetadata = getLineMetadata;
7400
7408
  function forEachLine(lineMetadata, handler) {
7401
7409
  for (const metadata of lineMetadata) {
7402
7410
  handler(...metadata);
@@ -7624,7 +7632,18 @@ var require_helpers2 = __commonJS({
7624
7632
  if (definitions.has(reference)) {
7625
7633
  duplicateDefinitions.push([reference, token.startLine - 1]);
7626
7634
  } else {
7627
- definitions.set(reference, token.startLine - 1);
7635
+ let destinationString = null;
7636
+ const parent = micromark.getTokenParentOfType(token, ["definition"]);
7637
+ if (parent) {
7638
+ destinationString = micromark.getTokenTextByType(
7639
+ micromark.filterByPredicate(parent.children),
7640
+ "definitionDestinationString"
7641
+ );
7642
+ }
7643
+ definitions.set(
7644
+ reference,
7645
+ [token.startLine - 1, destinationString]
7646
+ );
7628
7647
  }
7629
7648
  }
7630
7649
  break;
@@ -7749,7 +7768,7 @@ var require_helpers2 = __commonJS({
7749
7768
  }
7750
7769
  module2.exports.applyFix = applyFix2;
7751
7770
  function applyFixes2(input, errors) {
7752
- const lineEnding = getPreferredLineEnding(input, require("os"));
7771
+ const lineEnding = getPreferredLineEnding(input, require("node:os"));
7753
7772
  const lines = input.split(newLineRe);
7754
7773
  let fixInfos = errors.filter((error) => error.fixInfo).map((error) => normalizeFixInfo(error.fixInfo, error.lineNumber));
7755
7774
  fixInfos.sort((a, b) => {
@@ -7803,9 +7822,9 @@ var require_md001 = __commonJS({
7803
7822
  "use strict";
7804
7823
  var { addErrorDetailIf, filterTokens } = require_helpers2();
7805
7824
  module2.exports = {
7806
- "names": ["MD001", "heading-increment", "header-increment"],
7825
+ "names": ["MD001", "heading-increment"],
7807
7826
  "description": "Heading levels should only increment by one level at a time",
7808
- "tags": ["headings", "headers"],
7827
+ "tags": ["headings"],
7809
7828
  "function": function MD001(params, onError) {
7810
7829
  let prevLevel = 0;
7811
7830
  filterTokens(params, "heading_open", function forToken(token) {
@@ -7825,39 +7844,15 @@ var require_md001 = __commonJS({
7825
7844
  }
7826
7845
  });
7827
7846
 
7828
- // node_modules/markdownlint/lib/md002.js
7829
- var require_md002 = __commonJS({
7830
- "node_modules/markdownlint/lib/md002.js"(exports, module2) {
7831
- "use strict";
7832
- var { addErrorDetailIf } = require_helpers2();
7833
- module2.exports = {
7834
- "names": ["MD002", "first-heading-h1", "first-header-h1"],
7835
- "description": "First heading should be a top-level heading",
7836
- "tags": ["headings", "headers"],
7837
- "function": function MD002(params, onError) {
7838
- const level = Number(params.config.level || 1);
7839
- const tag = "h" + level;
7840
- params.parsers.markdownit.tokens.every(function forToken(token) {
7841
- if (token.type === "heading_open") {
7842
- addErrorDetailIf(onError, token.lineNumber, tag, token.tag);
7843
- return false;
7844
- }
7845
- return true;
7846
- });
7847
- }
7848
- };
7849
- }
7850
- });
7851
-
7852
7847
  // node_modules/markdownlint/lib/md003.js
7853
7848
  var require_md003 = __commonJS({
7854
7849
  "node_modules/markdownlint/lib/md003.js"(exports, module2) {
7855
7850
  "use strict";
7856
7851
  var { addErrorDetailIf, filterTokens, headingStyleFor } = require_helpers2();
7857
7852
  module2.exports = {
7858
- "names": ["MD003", "heading-style", "header-style"],
7853
+ "names": ["MD003", "heading-style"],
7859
7854
  "description": "Heading style",
7860
- "tags": ["headings", "headers"],
7855
+ "tags": ["headings"],
7861
7856
  "function": function MD003(params, onError) {
7862
7857
  let style = String(params.config.style || "consistent");
7863
7858
  filterTokens(params, "heading_open", function forToken(token) {
@@ -7985,30 +7980,28 @@ var require_md004 = __commonJS({
7985
7980
  var require_md005 = __commonJS({
7986
7981
  "node_modules/markdownlint/lib/md005.js"(exports, module2) {
7987
7982
  "use strict";
7988
- var {
7989
- addError,
7990
- addErrorDetailIf,
7991
- indentFor,
7992
- listItemMarkerRe,
7993
- orderedListItemMarkerRe,
7994
- rangeFromRegExp
7995
- } = require_helpers2();
7996
- var { flattenedLists } = require_cache();
7983
+ var { addError, addErrorDetailIf } = require_helpers2();
7984
+ var { filterByTypes, inHtmlFlow } = require_micromark2();
7997
7985
  module2.exports = {
7998
7986
  "names": ["MD005", "list-indent"],
7999
7987
  "description": "Inconsistent indentation for list items at the same level",
8000
7988
  "tags": ["bullet", "ul", "indentation"],
8001
7989
  "function": function MD005(params, onError) {
8002
- for (const list of flattenedLists()) {
8003
- const expectedIndent = list.indent;
7990
+ const lists = filterByTypes(
7991
+ params.parsers.micromark.tokens,
7992
+ ["listOrdered", "listUnordered"]
7993
+ ).filter((list) => !inHtmlFlow(list));
7994
+ for (const list of lists) {
7995
+ const expectedIndent = list.startColumn - 1;
8004
7996
  let expectedEnd = 0;
8005
- let actualEnd = -1;
8006
7997
  let endMatching = false;
8007
- for (const item of list.items) {
8008
- const { line, lineNumber } = item;
8009
- const actualIndent = indentFor(item);
8010
- let match = null;
8011
- if (list.unordered) {
7998
+ const listItemPrefixes = list.children.filter((token) => token.type === "listItemPrefix");
7999
+ for (const listItemPrefix of listItemPrefixes) {
8000
+ const lineNumber = listItemPrefix.startLine;
8001
+ const actualIndent = listItemPrefix.startColumn - 1;
8002
+ const markerLength = listItemPrefix.text.trim().length;
8003
+ const range = [1, listItemPrefix.startColumn + markerLength];
8004
+ if (list.type === "listUnordered") {
8012
8005
  addErrorDetailIf(
8013
8006
  onError,
8014
8007
  lineNumber,
@@ -8016,13 +8009,12 @@ var require_md005 = __commonJS({
8016
8009
  actualIndent,
8017
8010
  null,
8018
8011
  null,
8019
- rangeFromRegExp(line, listItemMarkerRe)
8012
+ range
8020
8013
  // No fixInfo; MD007 handles this scenario better
8021
8014
  );
8022
- } else if (match = orderedListItemMarkerRe.exec(line)) {
8023
- actualEnd = match[0].length;
8015
+ } else {
8016
+ const actualEnd = range[1] - 1;
8024
8017
  expectedEnd = expectedEnd || actualEnd;
8025
- const markerLength = match[1].length + 1;
8026
8018
  if (expectedIndent !== actualIndent || endMatching) {
8027
8019
  if (expectedEnd === actualEnd) {
8028
8020
  endMatching = true;
@@ -8034,8 +8026,8 @@ var require_md005 = __commonJS({
8034
8026
  onError,
8035
8027
  lineNumber,
8036
8028
  detail,
8037
- null,
8038
- rangeFromRegExp(line, listItemMarkerRe),
8029
+ void 0,
8030
+ range,
8039
8031
  {
8040
8032
  "editColumn": Math.min(actual, expected) + 1,
8041
8033
  "deleteCount": Math.max(actual - expected, 0),
@@ -8052,47 +8044,14 @@ var require_md005 = __commonJS({
8052
8044
  }
8053
8045
  });
8054
8046
 
8055
- // node_modules/markdownlint/lib/md006.js
8056
- var require_md006 = __commonJS({
8057
- "node_modules/markdownlint/lib/md006.js"(exports, module2) {
8058
- "use strict";
8059
- var { addErrorDetailIf, listItemMarkerRe, rangeFromRegExp } = require_helpers2();
8060
- var { flattenedLists } = require_cache();
8061
- module2.exports = {
8062
- "names": ["MD006", "ul-start-left"],
8063
- "description": "Consider starting bulleted lists at the beginning of the line",
8064
- "tags": ["bullet", "ul", "indentation"],
8065
- "function": function MD006(params, onError) {
8066
- for (const list of flattenedLists()) {
8067
- if (list.unordered && !list.nesting && list.indent !== 0) {
8068
- for (const item of list.items) {
8069
- const { lineNumber, line } = item;
8070
- addErrorDetailIf(
8071
- onError,
8072
- lineNumber,
8073
- 0,
8074
- list.indent,
8075
- null,
8076
- null,
8077
- rangeFromRegExp(line, listItemMarkerRe),
8078
- {
8079
- "deleteCount": line.length - line.trimStart().length
8080
- }
8081
- );
8082
- }
8083
- }
8084
- }
8085
- }
8086
- };
8087
- }
8088
- });
8089
-
8090
8047
  // node_modules/markdownlint/lib/md007.js
8091
8048
  var require_md007 = __commonJS({
8092
8049
  "node_modules/markdownlint/lib/md007.js"(exports, module2) {
8093
8050
  "use strict";
8094
- var { addErrorDetailIf, indentFor, listItemMarkerRe } = require_helpers2();
8095
- var { flattenedLists } = require_cache();
8051
+ var { addErrorDetailIf } = require_helpers2();
8052
+ var { filterByTypes, getTokenParentOfType, inHtmlFlow } = require_micromark2();
8053
+ var unorderedListTypes = ["blockQuotePrefix", "listItemPrefix", "listUnordered"];
8054
+ var unorderedParentTypes = ["blockQuote", "listOrdered", "listUnordered"];
8096
8055
  module2.exports = {
8097
8056
  "names": ["MD007", "ul-indent"],
8098
8057
  "description": "Unordered list indentation",
@@ -8101,32 +8060,52 @@ var require_md007 = __commonJS({
8101
8060
  const indent = Number(params.config.indent || 2);
8102
8061
  const startIndented = !!params.config.start_indented;
8103
8062
  const startIndent = Number(params.config.start_indent || indent);
8104
- for (const list of flattenedLists()) {
8105
- if (list.unordered && list.parentsUnordered) {
8106
- for (const item of list.items) {
8107
- const { lineNumber, line } = item;
8108
- const expectedIndent = (startIndented ? startIndent : 0) + list.nesting * indent;
8109
- const actualIndent = indentFor(item);
8110
- let range = null;
8111
- let editColumn = 1;
8112
- const match = line.match(listItemMarkerRe);
8113
- if (match) {
8114
- range = [1, match[0].length];
8115
- editColumn += match[1].length - actualIndent;
8063
+ const unorderedListNesting = /* @__PURE__ */ new Map();
8064
+ let lastBlockQuotePrefix = null;
8065
+ const tokens = filterByTypes(
8066
+ params.parsers.micromark.tokens,
8067
+ unorderedListTypes
8068
+ );
8069
+ for (const token of tokens) {
8070
+ const { parent, startColumn, startLine, type: type2 } = token;
8071
+ if (type2 === "blockQuotePrefix") {
8072
+ lastBlockQuotePrefix = token;
8073
+ } else if (type2 === "listUnordered") {
8074
+ let nesting = 0;
8075
+ let current = token;
8076
+ while (current = getTokenParentOfType(current, unorderedParentTypes)) {
8077
+ if (current.type === "listUnordered") {
8078
+ nesting++;
8079
+ continue;
8080
+ } else if (current.type === "listOrdered") {
8081
+ nesting = -1;
8116
8082
  }
8083
+ break;
8084
+ }
8085
+ if (nesting >= 0) {
8086
+ unorderedListNesting.set(token, nesting);
8087
+ }
8088
+ } else if (!inHtmlFlow(token)) {
8089
+ const nesting = unorderedListNesting.get(parent);
8090
+ if (nesting !== void 0) {
8091
+ const expectedIndent = (startIndented ? startIndent : 0) + nesting * indent;
8092
+ const blockQuoteAdjustment = lastBlockQuotePrefix?.endLine === startLine ? lastBlockQuotePrefix.endColumn - 1 : 0;
8093
+ const actualIndent = startColumn - 1 - blockQuoteAdjustment;
8094
+ const range = [1, startColumn + 1];
8095
+ const fixInfo = {
8096
+ "editColumn": startColumn - actualIndent,
8097
+ "deleteCount": Math.max(actualIndent - expectedIndent, 0),
8098
+ "insertText": "".padEnd(Math.max(expectedIndent - actualIndent, 0))
8099
+ };
8117
8100
  addErrorDetailIf(
8118
8101
  onError,
8119
- lineNumber,
8102
+ startLine,
8120
8103
  expectedIndent,
8121
8104
  actualIndent,
8122
- null,
8123
- null,
8105
+ void 0,
8106
+ void 0,
8124
8107
  range,
8125
- {
8126
- editColumn,
8127
- "deleteCount": actualIndent,
8128
- "insertText": "".padEnd(expectedIndent)
8129
- }
8108
+ fixInfo
8130
8109
  );
8131
8110
  }
8132
8111
  }
@@ -8398,10 +8377,7 @@ var require_md013 = __commonJS({
8398
8377
  const includeCodeBlocks = codeBlocks === void 0 ? true : !!codeBlocks;
8399
8378
  const tables = params.config.tables;
8400
8379
  const includeTables = tables === void 0 ? true : !!tables;
8401
- let headings = params.config.headings;
8402
- if (headings === void 0) {
8403
- headings = params.config.headers;
8404
- }
8380
+ const headings = params.config.headings;
8405
8381
  const includeHeadings = headings === void 0 ? true : !!headings;
8406
8382
  const headingLineNumbers = [];
8407
8383
  forEachHeading(params, (heading) => {
@@ -8505,7 +8481,7 @@ var require_md018 = __commonJS({
8505
8481
  module2.exports = {
8506
8482
  "names": ["MD018", "no-missing-space-atx"],
8507
8483
  "description": "No space after hash on atx style heading",
8508
- "tags": ["headings", "headers", "atx", "spaces"],
8484
+ "tags": ["headings", "atx", "spaces"],
8509
8485
  "function": function MD018(params, onError) {
8510
8486
  forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
8511
8487
  if (!inCode && /^#+[^# \t]/.test(line) && !/#\s*$/.test(line) && !line.startsWith("#\uFE0F\u20E3")) {
@@ -8537,7 +8513,7 @@ var require_md019 = __commonJS({
8537
8513
  module2.exports = {
8538
8514
  "names": ["MD019", "no-multiple-space-atx"],
8539
8515
  "description": "Multiple spaces after hash on atx style heading",
8540
- "tags": ["headings", "headers", "atx", "spaces"],
8516
+ "tags": ["headings", "atx", "spaces"],
8541
8517
  "function": function MD019(params, onError) {
8542
8518
  filterTokens(params, "heading_open", (token) => {
8543
8519
  if (headingStyleFor(token) === "atx") {
@@ -8578,7 +8554,7 @@ var require_md020 = __commonJS({
8578
8554
  module2.exports = {
8579
8555
  "names": ["MD020", "no-missing-space-closed-atx"],
8580
8556
  "description": "No space inside hashes on closed atx style heading",
8581
- "tags": ["headings", "headers", "atx_closed", "spaces"],
8557
+ "tags": ["headings", "atx_closed", "spaces"],
8582
8558
  "function": function MD020(params, onError) {
8583
8559
  forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
8584
8560
  if (!inCode) {
@@ -8638,7 +8614,7 @@ var require_md021 = __commonJS({
8638
8614
  module2.exports = {
8639
8615
  "names": ["MD021", "no-multiple-space-closed-atx"],
8640
8616
  "description": "Multiple spaces inside hashes on closed atx style heading",
8641
- "tags": ["headings", "headers", "atx_closed", "spaces"],
8617
+ "tags": ["headings", "atx_closed", "spaces"],
8642
8618
  "function": function MD021(params, onError) {
8643
8619
  filterTokens(params, "heading_open", (token) => {
8644
8620
  if (headingStyleFor(token) === "atx_closed") {
@@ -8694,7 +8670,7 @@ var require_md022 = __commonJS({
8694
8670
  "node_modules/markdownlint/lib/md022.js"(exports, module2) {
8695
8671
  "use strict";
8696
8672
  var { addErrorDetailIf, blockquotePrefixRe, isBlankLine } = require_helpers2();
8697
- var { filterByTypes, getHeadingLevel } = require_micromark2();
8673
+ var { filterByTypes, getHeadingLevel, inHtmlFlow } = require_micromark2();
8698
8674
  var defaultLines = 1;
8699
8675
  var getLinesFunction = (linesParam) => {
8700
8676
  if (Array.isArray(linesParam)) {
@@ -8709,9 +8685,9 @@ var require_md022 = __commonJS({
8709
8685
  };
8710
8686
  var getBlockQuote = (str2, count) => (str2 || "").match(blockquotePrefixRe)[0].trimEnd().concat("\n").repeat(count);
8711
8687
  module2.exports = {
8712
- "names": ["MD022", "blanks-around-headings", "blanks-around-headers"],
8688
+ "names": ["MD022", "blanks-around-headings"],
8713
8689
  "description": "Headings should be surrounded by blank lines",
8714
- "tags": ["headings", "headers", "blank_lines"],
8690
+ "tags": ["headings", "blank_lines"],
8715
8691
  "function": function MD022(params, onError) {
8716
8692
  const getLinesAbove = getLinesFunction(params.config.lines_above);
8717
8693
  const getLinesBelow = getLinesFunction(params.config.lines_below);
@@ -8719,7 +8695,7 @@ var require_md022 = __commonJS({
8719
8695
  const headings = filterByTypes(
8720
8696
  parsers.micromark.tokens,
8721
8697
  ["atxHeading", "setextHeading"]
8722
- );
8698
+ ).filter((heading) => !inHtmlFlow(heading));
8723
8699
  for (const heading of headings) {
8724
8700
  const { startLine, endLine } = heading;
8725
8701
  const line = lines[startLine - 1].trim();
@@ -8781,9 +8757,9 @@ var require_md023 = __commonJS({
8781
8757
  var { addErrorContext, filterTokens } = require_helpers2();
8782
8758
  var spaceBeforeHeadingRe = /^(\s+|[>\s]+\s\s)[^>\s]/;
8783
8759
  module2.exports = {
8784
- "names": ["MD023", "heading-start-left", "header-start-left"],
8760
+ "names": ["MD023", "heading-start-left"],
8785
8761
  "description": "Headings must start at the beginning of the line",
8786
- "tags": ["headings", "headers", "spaces"],
8762
+ "tags": ["headings", "spaces"],
8787
8763
  "function": function MD023(params, onError) {
8788
8764
  filterTokens(params, "heading_open", function forToken(token) {
8789
8765
  const { lineNumber, line } = token;
@@ -8820,9 +8796,9 @@ var require_md024 = __commonJS({
8820
8796
  "use strict";
8821
8797
  var { addErrorContext, forEachHeading } = require_helpers2();
8822
8798
  module2.exports = {
8823
- "names": ["MD024", "no-duplicate-heading", "no-duplicate-header"],
8799
+ "names": ["MD024", "no-duplicate-heading"],
8824
8800
  "description": "Multiple headings with the same content",
8825
- "tags": ["headings", "headers"],
8801
+ "tags": ["headings"],
8826
8802
  "function": function MD024(params, onError) {
8827
8803
  const siblingsOnly = !!params.config.siblings_only || !!params.config.allow_different_nesting || false;
8828
8804
  const knownContents = [null, []];
@@ -8864,7 +8840,7 @@ var require_md025 = __commonJS({
8864
8840
  module2.exports = {
8865
8841
  "names": ["MD025", "single-title", "single-h1"],
8866
8842
  "description": "Multiple top-level headings in the same document",
8867
- "tags": ["headings", "headers"],
8843
+ "tags": ["headings"],
8868
8844
  "function": function MD025(params, onError) {
8869
8845
  const level = Number(params.config.level || 1);
8870
8846
  const tag = "h" + level;
@@ -8906,7 +8882,7 @@ var require_md026 = __commonJS({
8906
8882
  module2.exports = {
8907
8883
  "names": ["MD026", "no-trailing-punctuation"],
8908
8884
  "description": "Trailing punctuation in heading",
8909
- "tags": ["headings", "headers"],
8885
+ "tags": ["headings"],
8910
8886
  "function": function MD026(params, onError) {
8911
8887
  let punctuation = params.config.punctuation;
8912
8888
  punctuation = String(
@@ -9105,7 +9081,7 @@ var require_md030 = __commonJS({
9105
9081
  "node_modules/markdownlint/lib/md030.js"(exports, module2) {
9106
9082
  "use strict";
9107
9083
  var { addErrorDetailIf } = require_helpers2();
9108
- var { flattenedLists } = require_cache();
9084
+ var { filterByTypes } = require_micromark2();
9109
9085
  module2.exports = {
9110
9086
  "names": ["MD030", "list-marker-space"],
9111
9087
  "description": "Spaces after list markers",
@@ -9115,31 +9091,39 @@ var require_md030 = __commonJS({
9115
9091
  const olSingle = Number(params.config.ol_single || 1);
9116
9092
  const ulMulti = Number(params.config.ul_multi || 1);
9117
9093
  const olMulti = Number(params.config.ol_multi || 1);
9118
- for (const list of flattenedLists()) {
9119
- const lineCount = list.lastLineIndex - list.open.map[0];
9120
- const allSingle = lineCount === list.items.length;
9121
- const expectedSpaces = list.unordered ? allSingle ? ulSingle : ulMulti : allSingle ? olSingle : olMulti;
9122
- for (const item of list.items) {
9123
- const { line, lineNumber } = item;
9124
- const match = /^[\s>]*\S+(\s*)/.exec(line);
9125
- const [{ "length": matchLength }, { "length": actualSpaces }] = match;
9126
- if (matchLength < line.length) {
9127
- let fixInfo = null;
9128
- if (expectedSpaces !== actualSpaces) {
9129
- fixInfo = {
9130
- "editColumn": matchLength - actualSpaces + 1,
9131
- "deleteCount": actualSpaces,
9132
- "insertText": "".padEnd(expectedSpaces)
9133
- };
9134
- }
9094
+ const lists = filterByTypes(
9095
+ params.parsers.micromark.tokens,
9096
+ ["listOrdered", "listUnordered"]
9097
+ );
9098
+ for (const list of lists) {
9099
+ const ordered = list.type === "listOrdered";
9100
+ const listItemPrefixes = list.children.filter((token) => token.type === "listItemPrefix");
9101
+ const allSingleLine = list.endLine - list.startLine + 1 === listItemPrefixes.length;
9102
+ const expectedSpaces = ordered ? allSingleLine ? olSingle : olMulti : allSingleLine ? ulSingle : ulMulti;
9103
+ for (const listItemPrefix of listItemPrefixes) {
9104
+ const range = [
9105
+ listItemPrefix.startColumn,
9106
+ listItemPrefix.endColumn - listItemPrefix.startColumn
9107
+ ];
9108
+ const listItemPrefixWhitespaces = listItemPrefix.children.filter(
9109
+ (token) => token.type === "listItemPrefixWhitespace"
9110
+ );
9111
+ for (const listItemPrefixWhitespace of listItemPrefixWhitespaces) {
9112
+ const { endColumn, startColumn, startLine } = listItemPrefixWhitespace;
9113
+ const actualSpaces = endColumn - startColumn;
9114
+ const fixInfo = {
9115
+ "editColumn": startColumn,
9116
+ "deleteCount": actualSpaces,
9117
+ "insertText": "".padEnd(expectedSpaces)
9118
+ };
9135
9119
  addErrorDetailIf(
9136
9120
  onError,
9137
- lineNumber,
9121
+ startLine,
9138
9122
  expectedSpaces,
9139
9123
  actualSpaces,
9140
9124
  null,
9141
9125
  null,
9142
- [1, matchLength],
9126
+ range,
9143
9127
  fixInfo
9144
9128
  );
9145
9129
  }
@@ -9196,7 +9180,7 @@ var require_md032 = __commonJS({
9196
9180
  "node_modules/markdownlint/lib/md032.js"(exports, module2) {
9197
9181
  "use strict";
9198
9182
  var { addErrorContext, blockquotePrefixRe, isBlankLine } = require_helpers2();
9199
- var { filterByPredicate, flattenedChildren } = require_micromark2();
9183
+ var { filterByPredicate } = require_micromark2();
9200
9184
  var nonContentTokens = /* @__PURE__ */ new Set([
9201
9185
  "blockQuoteMarker",
9202
9186
  "blockQuotePrefix",
@@ -9233,7 +9217,7 @@ var require_md032 = __commonJS({
9233
9217
  const topLevelLists = filterByPredicate(
9234
9218
  parsers.micromark.tokens,
9235
9219
  isList,
9236
- (token) => isList(token) ? [] : token.children
9220
+ (token) => isList(token) || token.type === "htmlFlow" ? [] : token.children
9237
9221
  );
9238
9222
  for (const list of topLevelLists) {
9239
9223
  const firstIndex = list.startLine - 1;
@@ -9241,7 +9225,8 @@ var require_md032 = __commonJS({
9241
9225
  addBlankLineError(onError, lines, firstIndex);
9242
9226
  }
9243
9227
  let endLine = list.endLine;
9244
- for (const child of flattenedChildren(list).reverse()) {
9228
+ const flattenedChildren = filterByPredicate(list.children);
9229
+ for (const child of flattenedChildren.reverse()) {
9245
9230
  if (!nonContentTokens.has(child.type)) {
9246
9231
  endLine = child.endLine;
9247
9232
  break;
@@ -9261,9 +9246,8 @@ var require_md032 = __commonJS({
9261
9246
  var require_md033 = __commonJS({
9262
9247
  "node_modules/markdownlint/lib/md033.js"(exports, module2) {
9263
9248
  "use strict";
9264
- var { addError } = require_helpers2();
9265
- var { filterByHtmlTokens, getHtmlTagInfo } = require_micromark2();
9266
- var nextLinesRe = /[\r\n][\s\S]*$/;
9249
+ var { addError, nextLinesRe } = require_helpers2();
9250
+ var { filterByTypes, getHtmlTagInfo } = require_micromark2();
9267
9251
  module2.exports = {
9268
9252
  "names": ["MD033", "no-inline-html"],
9269
9253
  "description": "Inline HTML",
@@ -9272,7 +9256,8 @@ var require_md033 = __commonJS({
9272
9256
  let allowedElements = params.config.allowed_elements;
9273
9257
  allowedElements = Array.isArray(allowedElements) ? allowedElements : [];
9274
9258
  allowedElements = allowedElements.map((element) => element.toLowerCase());
9275
- for (const token of filterByHtmlTokens(params.parsers.micromark.tokens)) {
9259
+ const { tokens } = params.parsers.micromark;
9260
+ for (const token of filterByTypes(tokens, ["htmlText"])) {
9276
9261
  const htmlTagInfo = getHtmlTagInfo(token);
9277
9262
  if (htmlTagInfo && !htmlTagInfo.close && !allowedElements.includes(htmlTagInfo.name.toLowerCase())) {
9278
9263
  const range = [
@@ -9298,7 +9283,7 @@ var require_md034 = __commonJS({
9298
9283
  "node_modules/markdownlint/lib/md034.js"(exports, module2) {
9299
9284
  "use strict";
9300
9285
  var { addErrorContext } = require_helpers2();
9301
- var { filterByPredicate, getHtmlTagInfo, parse } = require_micromark2();
9286
+ var { filterByPredicate, filterByTypes, getHtmlTagInfo, inHtmlFlow, parse } = require_micromark2();
9302
9287
  module2.exports = {
9303
9288
  "names": ["MD034", "no-bare-urls"],
9304
9289
  "description": "Bare URL used",
@@ -9306,18 +9291,18 @@ var require_md034 = __commonJS({
9306
9291
  "function": function MD034(params, onError) {
9307
9292
  const literalAutolinks = (tokens) => filterByPredicate(
9308
9293
  tokens,
9309
- (token) => token.type === "literalAutolink",
9294
+ (token) => token.type === "literalAutolink" && !inHtmlFlow(token),
9310
9295
  (token) => {
9311
9296
  const { children } = token;
9312
9297
  const result = [];
9313
9298
  for (let i = 0; i < children.length; i++) {
9314
- const openToken = children[i];
9315
- const openTagInfo = getHtmlTagInfo(openToken);
9299
+ const current = children[i];
9300
+ const openTagInfo = getHtmlTagInfo(current);
9316
9301
  if (openTagInfo && !openTagInfo.close) {
9317
9302
  let count = 1;
9318
9303
  for (let j = i + 1; j < children.length; j++) {
9319
- const closeToken = children[j];
9320
- const closeTagInfo = getHtmlTagInfo(closeToken);
9304
+ const candidate = children[j];
9305
+ const closeTagInfo = getHtmlTagInfo(candidate);
9321
9306
  if (closeTagInfo && openTagInfo.name === closeTagInfo.name) {
9322
9307
  if (closeTagInfo.close) {
9323
9308
  count--;
@@ -9331,13 +9316,17 @@ var require_md034 = __commonJS({
9331
9316
  }
9332
9317
  }
9333
9318
  } else {
9334
- result.push(openToken);
9319
+ result.push(current);
9335
9320
  }
9336
9321
  }
9337
9322
  return result;
9338
9323
  }
9339
9324
  );
9340
- if (literalAutolinks(params.parsers.micromark.tokens).length > 0) {
9325
+ const autoLinks = filterByTypes(
9326
+ params.parsers.micromark.tokens,
9327
+ ["literalAutolink"]
9328
+ );
9329
+ if (autoLinks.length > 0) {
9341
9330
  const document = params.lines.join("\n");
9342
9331
  const tokens = parse(document, void 0, false);
9343
9332
  for (const token of literalAutolinks(tokens)) {
@@ -9397,9 +9386,9 @@ var require_md036 = __commonJS({
9397
9386
  "use strict";
9398
9387
  var { addErrorContext, allPunctuation } = require_helpers2();
9399
9388
  module2.exports = {
9400
- "names": ["MD036", "no-emphasis-as-heading", "no-emphasis-as-header"],
9389
+ "names": ["MD036", "no-emphasis-as-heading"],
9401
9390
  "description": "Emphasis used instead of a heading",
9402
- "tags": ["headings", "headers", "emphasis"],
9391
+ "tags": ["headings", "emphasis"],
9403
9392
  "function": function MD036(params, onError) {
9404
9393
  let punctuation = params.config.punctuation;
9405
9394
  punctuation = String(punctuation === void 0 ? allPunctuation : punctuation);
@@ -9450,8 +9439,7 @@ var require_md037 = __commonJS({
9450
9439
  "node_modules/markdownlint/lib/md037.js"(exports, module2) {
9451
9440
  "use strict";
9452
9441
  var { addError } = require_helpers2();
9453
- var emphasisStartTextRe = /^(\S{1,3})(\s+)\S/;
9454
- var emphasisEndTextRe = /\S(\s+)(\S{1,3})$/;
9442
+ var { filterByPredicate, inHtmlFlow } = require_micromark2();
9455
9443
  module2.exports = {
9456
9444
  "names": ["MD037", "no-space-in-emphasis"],
9457
9445
  "description": "Spaces inside emphasis markers",
@@ -9462,14 +9450,11 @@ var require_md037 = __commonJS({
9462
9450
  for (const marker of ["_", "__", "___", "*", "**", "***"]) {
9463
9451
  emphasisTokensByMarker.set(marker, []);
9464
9452
  }
9465
- const pending = [...parsers.micromark.tokens];
9466
- let token = null;
9467
- while (token = pending.shift()) {
9468
- if (token.type === "htmlFlow") {
9469
- pending.unshift(...token.htmlFlowChildren);
9470
- continue;
9471
- }
9472
- pending.push(...token.children);
9453
+ const tokens = filterByPredicate(
9454
+ parsers.micromark.tokens,
9455
+ (token) => token.children.some((child) => child.type === "data")
9456
+ );
9457
+ for (const token of tokens) {
9473
9458
  for (const emphasisTokens of emphasisTokensByMarker.values()) {
9474
9459
  emphasisTokens.length = 0;
9475
9460
  }
@@ -9477,50 +9462,51 @@ var require_md037 = __commonJS({
9477
9462
  const { text, type: type2 } = child;
9478
9463
  if (type2 === "data" && text.length <= 3) {
9479
9464
  const emphasisTokens = emphasisTokensByMarker.get(text);
9480
- if (emphasisTokens) {
9465
+ if (emphasisTokens && !inHtmlFlow(child)) {
9481
9466
  emphasisTokens.push(child);
9482
9467
  }
9483
9468
  }
9484
9469
  }
9485
- for (const emphasisTokens of emphasisTokensByMarker.values()) {
9470
+ for (const entry of emphasisTokensByMarker.entries()) {
9471
+ const [marker, emphasisTokens] = entry;
9486
9472
  for (let i = 0; i + 1 < emphasisTokens.length; i += 2) {
9487
9473
  const startToken = emphasisTokens[i];
9488
- const startText = lines[startToken.startLine - 1].slice(startToken.startColumn - 1);
9489
- const startMatch = startText.match(emphasisStartTextRe);
9474
+ const startLine = lines[startToken.startLine - 1];
9475
+ const startSlice = startLine.slice(startToken.endColumn - 1);
9476
+ const startMatch = startSlice.match(/^\s+\S/);
9490
9477
  if (startMatch) {
9491
- const [startContext, startMarker, startSpaces] = startMatch;
9492
- if (startMarker === startToken.text && startSpaces.length > 0) {
9493
- addError(
9494
- onError,
9495
- startToken.startLine,
9496
- void 0,
9497
- startContext,
9498
- [startToken.startColumn, startContext.length],
9499
- {
9500
- "editColumn": startToken.endColumn,
9501
- "deleteCount": startSpaces.length
9502
- }
9503
- );
9504
- }
9478
+ const [startSpaceCharacter] = startMatch;
9479
+ const startContext = `${marker}${startSpaceCharacter}`;
9480
+ addError(
9481
+ onError,
9482
+ startToken.startLine,
9483
+ void 0,
9484
+ startContext,
9485
+ [startToken.startColumn, startContext.length],
9486
+ {
9487
+ "editColumn": startToken.endColumn,
9488
+ "deleteCount": startSpaceCharacter.length - 1
9489
+ }
9490
+ );
9505
9491
  }
9506
9492
  const endToken = emphasisTokens[i + 1];
9507
- const endText = lines[endToken.startLine - 1].slice(0, endToken.endColumn - 1);
9508
- const endMatch = endText.match(emphasisEndTextRe);
9493
+ const endLine = lines[endToken.startLine - 1];
9494
+ const endSlice = endLine.slice(0, endToken.startColumn - 1);
9495
+ const endMatch = endSlice.match(/\S\s+$/);
9509
9496
  if (endMatch) {
9510
- const [endContext, endSpace, endMarker] = endMatch;
9511
- if (endMarker === endToken.text && endSpace.length > 0) {
9512
- addError(
9513
- onError,
9514
- endToken.startLine,
9515
- void 0,
9516
- endContext,
9517
- [endToken.endColumn - endContext.length, endContext.length],
9518
- {
9519
- "editColumn": endToken.startColumn - endSpace.length,
9520
- "deleteCount": endSpace.length
9521
- }
9522
- );
9523
- }
9497
+ const [endSpaceCharacter] = endMatch;
9498
+ const endContext = `${endSpaceCharacter}${marker}`;
9499
+ addError(
9500
+ onError,
9501
+ endToken.startLine,
9502
+ void 0,
9503
+ endContext,
9504
+ [endToken.endColumn - endContext.length, endContext.length],
9505
+ {
9506
+ "editColumn": endToken.startColumn - (endSpaceCharacter.length - 1),
9507
+ "deleteCount": endSpaceCharacter.length - 1
9508
+ }
9509
+ );
9524
9510
  }
9525
9511
  }
9526
9512
  }
@@ -9535,7 +9521,7 @@ var require_md038 = __commonJS({
9535
9521
  "node_modules/markdownlint/lib/md038.js"(exports, module2) {
9536
9522
  "use strict";
9537
9523
  var { addErrorContext } = require_helpers2();
9538
- var { filterByTypes, tokenIfType } = require_micromark2();
9524
+ var { filterByTypes, inHtmlFlow, tokenIfType } = require_micromark2();
9539
9525
  var leftSpaceRe = /^\s(?:[^`]|$)/;
9540
9526
  var rightSpaceRe = /[^`]\s$/;
9541
9527
  var trimCodeText = (text, start, end) => {
@@ -9553,9 +9539,9 @@ var require_md038 = __commonJS({
9553
9539
  "description": "Spaces inside code span elements",
9554
9540
  "tags": ["whitespace", "code"],
9555
9541
  "function": function MD038(params, onError) {
9556
- const codeTextTokens = filterByTypes(params.parsers.micromark.tokens, ["codeText"]);
9557
- for (const token of codeTextTokens) {
9558
- const { children } = token;
9542
+ const codeTexts = filterByTypes(params.parsers.micromark.tokens, ["codeText"]).filter((codeText) => !inHtmlFlow(codeText));
9543
+ for (const codeText of codeTexts) {
9544
+ const { children } = codeText;
9559
9545
  const first = 0;
9560
9546
  const last = children.length - 1;
9561
9547
  const startSequence = tokenIfType(children[first], "codeTextSequence");
@@ -9729,7 +9715,7 @@ var require_md041 = __commonJS({
9729
9715
  module2.exports = {
9730
9716
  "names": ["MD041", "first-line-heading", "first-line-h1"],
9731
9717
  "description": "First line in a file should be a top-level heading",
9732
- "tags": ["headings", "headers"],
9718
+ "tags": ["headings"],
9733
9719
  "function": function MD041(params, onError) {
9734
9720
  const level = Number(params.config.level || 1);
9735
9721
  const tag = "h" + level;
@@ -9822,59 +9808,60 @@ var require_md043 = __commonJS({
9822
9808
  "use strict";
9823
9809
  var { addErrorContext, addErrorDetailIf, forEachHeading } = require_helpers2();
9824
9810
  module2.exports = {
9825
- "names": ["MD043", "required-headings", "required-headers"],
9811
+ "names": ["MD043", "required-headings"],
9826
9812
  "description": "Required heading structure",
9827
- "tags": ["headings", "headers"],
9813
+ "tags": ["headings"],
9828
9814
  "function": function MD043(params, onError) {
9829
- const requiredHeadings = params.config.headings || params.config.headers;
9815
+ const requiredHeadings = params.config.headings;
9816
+ if (!Array.isArray(requiredHeadings)) {
9817
+ return;
9818
+ }
9830
9819
  const matchCase = params.config.match_case || false;
9831
- if (Array.isArray(requiredHeadings)) {
9832
- const levels = {};
9833
- for (const level of [1, 2, 3, 4, 5, 6]) {
9834
- levels["h" + level] = "######".substr(-level);
9835
- }
9836
- let i = 0;
9837
- let matchAny = false;
9838
- let hasError = false;
9839
- let anyHeadings = false;
9840
- const getExpected = () => requiredHeadings[i++] || "[None]";
9841
- const handleCase = (str2) => matchCase ? str2 : str2.toLowerCase();
9842
- forEachHeading(params, (heading, content) => {
9843
- if (!hasError) {
9844
- anyHeadings = true;
9845
- const actual = levels[heading.tag] + " " + content;
9846
- const expected = getExpected();
9847
- if (expected === "*") {
9848
- const nextExpected = getExpected();
9849
- if (handleCase(nextExpected) !== handleCase(actual)) {
9850
- matchAny = true;
9851
- i--;
9852
- }
9853
- } else if (expected === "+") {
9820
+ const levels = {};
9821
+ for (const level of [1, 2, 3, 4, 5, 6]) {
9822
+ levels["h" + level] = "######".substr(-level);
9823
+ }
9824
+ let i = 0;
9825
+ let matchAny = false;
9826
+ let hasError = false;
9827
+ let anyHeadings = false;
9828
+ const getExpected = () => requiredHeadings[i++] || "[None]";
9829
+ const handleCase = (str2) => matchCase ? str2 : str2.toLowerCase();
9830
+ forEachHeading(params, (heading, content) => {
9831
+ if (!hasError) {
9832
+ anyHeadings = true;
9833
+ const actual = levels[heading.tag] + " " + content;
9834
+ const expected = getExpected();
9835
+ if (expected === "*") {
9836
+ const nextExpected = getExpected();
9837
+ if (handleCase(nextExpected) !== handleCase(actual)) {
9854
9838
  matchAny = true;
9855
- } else if (handleCase(expected) === handleCase(actual)) {
9856
- matchAny = false;
9857
- } else if (matchAny) {
9858
9839
  i--;
9859
- } else {
9860
- addErrorDetailIf(
9861
- onError,
9862
- heading.lineNumber,
9863
- expected,
9864
- actual
9865
- );
9866
- hasError = true;
9867
9840
  }
9841
+ } else if (expected === "+") {
9842
+ matchAny = true;
9843
+ } else if (handleCase(expected) === handleCase(actual)) {
9844
+ matchAny = false;
9845
+ } else if (matchAny) {
9846
+ i--;
9847
+ } else {
9848
+ addErrorDetailIf(
9849
+ onError,
9850
+ heading.lineNumber,
9851
+ expected,
9852
+ actual
9853
+ );
9854
+ hasError = true;
9868
9855
  }
9869
- });
9870
- const extraHeadings = requiredHeadings.length - i;
9871
- if (!hasError && (extraHeadings > 1 || extraHeadings === 1 && requiredHeadings[i] !== "*") && (anyHeadings || !requiredHeadings.every((heading) => heading === "*"))) {
9872
- addErrorContext(
9873
- onError,
9874
- params.lines.length,
9875
- requiredHeadings[i]
9876
- );
9877
9856
  }
9857
+ });
9858
+ const extraHeadings = requiredHeadings.length - i;
9859
+ if (!hasError && (extraHeadings > 1 || extraHeadings === 1 && requiredHeadings[i] !== "*") && (anyHeadings || !requiredHeadings.every((heading) => heading === "*"))) {
9860
+ addErrorContext(
9861
+ onError,
9862
+ params.lines.length,
9863
+ requiredHeadings[i]
9864
+ );
9878
9865
  }
9879
9866
  }
9880
9867
  };
@@ -9885,7 +9872,7 @@ var require_md043 = __commonJS({
9885
9872
  var require_md044 = __commonJS({
9886
9873
  "node_modules/markdownlint/lib/md044.js"(exports, module2) {
9887
9874
  "use strict";
9888
- var { addErrorDetailIf, escapeForRegExp, newLineRe, withinAnyRange } = require_helpers2();
9875
+ var { addErrorDetailIf, escapeForRegExp, withinAnyRange } = require_helpers2();
9889
9876
  var { filterByPredicate, filterByTypes, parse } = require_micromark2();
9890
9877
  var ignoredChildTypes = /* @__PURE__ */ new Set(
9891
9878
  ["codeFencedFence", "definition", "reference", "resource"]
@@ -9898,42 +9885,26 @@ var require_md044 = __commonJS({
9898
9885
  let names = params.config.names;
9899
9886
  names = Array.isArray(names) ? names : [];
9900
9887
  names.sort((a, b) => b.length - a.length || a.localeCompare(b));
9888
+ if (names.length === 0) {
9889
+ return;
9890
+ }
9901
9891
  const codeBlocks = params.config.code_blocks;
9902
9892
  const includeCodeBlocks = codeBlocks === void 0 ? true : !!codeBlocks;
9903
9893
  const htmlElements = params.config.html_elements;
9904
9894
  const includeHtmlElements = htmlElements === void 0 ? true : !!htmlElements;
9905
- const scannedTypes = /* @__PURE__ */ new Set(["data", "htmlFlowData"]);
9895
+ const scannedTypes = /* @__PURE__ */ new Set(["data"]);
9906
9896
  if (includeCodeBlocks) {
9907
9897
  scannedTypes.add("codeFlowValue");
9908
9898
  scannedTypes.add("codeTextData");
9909
9899
  }
9910
- const tokenAdjustments = /* @__PURE__ */ new Map();
9900
+ if (includeHtmlElements) {
9901
+ scannedTypes.add("htmlFlowData");
9902
+ scannedTypes.add("htmlTextData");
9903
+ }
9911
9904
  const contentTokens = filterByPredicate(
9912
9905
  params.parsers.micromark.tokens,
9913
9906
  (token) => scannedTypes.has(token.type),
9914
- (token) => {
9915
- let { children } = token;
9916
- const { startLine, text } = token;
9917
- if (!includeHtmlElements && token.type === "htmlFlow") {
9918
- if (text.startsWith("<!--")) {
9919
- children = [];
9920
- } else {
9921
- const htmlTextLines = `<md044>
9922
- ${text}
9923
- </md044>`.split(newLineRe);
9924
- children = parse(htmlTextLines.join(""));
9925
- const reTokens = [...children];
9926
- for (const reToken of reTokens) {
9927
- tokenAdjustments.set(reToken, {
9928
- htmlTextLines,
9929
- startLine
9930
- });
9931
- reTokens.push(...reToken.children);
9932
- }
9933
- }
9934
- }
9935
- return children.filter((t) => !ignoredChildTypes.has(t.type));
9936
- }
9907
+ (token) => token.children.filter((t) => !ignoredChildTypes.has(t.type))
9937
9908
  );
9938
9909
  const exclusions = [];
9939
9910
  const autoLinked = /* @__PURE__ */ new Set();
@@ -9967,21 +9938,10 @@ ${text}
9967
9938
  autoLinked.add(token);
9968
9939
  }
9969
9940
  if (!withinAnyRange(urlRanges, lineIndex, index, length)) {
9970
- let lineNumber = token.startLine;
9971
- let column = index;
9972
- if (tokenAdjustments.has(token)) {
9973
- const { htmlTextLines, startLine } = tokenAdjustments.get(token);
9974
- let lineDelta = 0;
9975
- while (htmlTextLines[lineDelta].length <= column) {
9976
- column -= htmlTextLines[lineDelta].length;
9977
- lineDelta++;
9978
- }
9979
- lineNumber = startLine + lineDelta - 1;
9980
- }
9981
- column++;
9941
+ const column = index + 1;
9982
9942
  addErrorDetailIf(
9983
9943
  onError,
9984
- lineNumber,
9944
+ token.startLine,
9985
9945
  name,
9986
9946
  nameMatch,
9987
9947
  null,
@@ -10008,14 +9968,16 @@ ${text}
10008
9968
  var require_md045 = __commonJS({
10009
9969
  "node_modules/markdownlint/lib/md045.js"(exports, module2) {
10010
9970
  "use strict";
10011
- var { addError } = require_helpers2();
10012
- var { filterByTypes } = require_micromark2();
9971
+ var { addError, getHtmlAttributeRe, nextLinesRe } = require_helpers2();
9972
+ var { filterByTypes, getHtmlTagInfo } = require_micromark2();
9973
+ var altRe = getHtmlAttributeRe("alt");
10013
9974
  module2.exports = {
10014
9975
  "names": ["MD045", "no-alt-text"],
10015
9976
  "description": "Images should have alternate text (alt text)",
10016
9977
  "tags": ["accessibility", "images"],
10017
9978
  "function": function MD045(params, onError) {
10018
- const images = filterByTypes(params.parsers.micromark.tokens, ["image"]);
9979
+ const { tokens } = params.parsers.micromark;
9980
+ const images = filterByTypes(tokens, ["image"]);
10019
9981
  for (const image of images) {
10020
9982
  const labelTexts = filterByTypes(image.children, ["labelText"]);
10021
9983
  if (labelTexts.some((labelText) => labelText.text.length === 0)) {
@@ -10029,6 +9991,24 @@ var require_md045 = __commonJS({
10029
9991
  );
10030
9992
  }
10031
9993
  }
9994
+ const htmlTexts = filterByTypes(tokens, ["htmlText"]);
9995
+ for (const htmlText of htmlTexts) {
9996
+ const { startColumn, startLine, text } = htmlText;
9997
+ const htmlTagInfo = getHtmlTagInfo(htmlText);
9998
+ if (htmlTagInfo && !htmlTagInfo.close && htmlTagInfo.name.toLowerCase() === "img" && !altRe.test(text)) {
9999
+ const range = [
10000
+ startColumn,
10001
+ text.replace(nextLinesRe, "").length
10002
+ ];
10003
+ addError(
10004
+ onError,
10005
+ startLine,
10006
+ void 0,
10007
+ void 0,
10008
+ range
10009
+ );
10010
+ }
10011
+ }
10032
10012
  }
10033
10013
  };
10034
10014
  }
@@ -10136,11 +10116,15 @@ var require_md049_md050 = __commonJS({
10136
10116
  "node_modules/markdownlint/lib/md049-md050.js"(exports, module2) {
10137
10117
  "use strict";
10138
10118
  var { addError, emphasisOrStrongStyleFor } = require_helpers2();
10139
- var { filterByTypes, tokenIfType } = require_micromark2();
10119
+ var { filterByPredicate, tokenIfType } = require_micromark2();
10140
10120
  var intrawordRe = /\w/;
10141
10121
  var impl = (params, onError, type2, asterisk, underline, style = "consistent") => {
10142
10122
  const { lines, parsers } = params;
10143
- const emphasisTokens = filterByTypes(parsers.micromark.tokens, [type2]);
10123
+ const emphasisTokens = filterByPredicate(
10124
+ parsers.micromark.tokens,
10125
+ (token) => token.type === type2,
10126
+ (token) => token.type === "htmlFlow" ? [] : token.children
10127
+ );
10144
10128
  for (const token of emphasisTokens) {
10145
10129
  const { children } = token;
10146
10130
  const childType = `${type2}Sequence`;
@@ -10180,7 +10164,7 @@ var require_md049_md050 = __commonJS({
10180
10164
  module2.exports = [
10181
10165
  {
10182
10166
  "names": ["MD049", "emphasis-style"],
10183
- "description": "Emphasis style should be consistent",
10167
+ "description": "Emphasis style",
10184
10168
  "tags": ["emphasis"],
10185
10169
  "function": function MD049(params, onError) {
10186
10170
  return impl(
@@ -10195,7 +10179,7 @@ var require_md049_md050 = __commonJS({
10195
10179
  },
10196
10180
  {
10197
10181
  "names": ["MD050", "strong-style"],
10198
- "description": "Strong style should be consistent",
10182
+ "description": "Strong style",
10199
10183
  "tags": ["emphasis"],
10200
10184
  "function": function MD050(params, onError) {
10201
10185
  return impl(
@@ -10216,13 +10200,21 @@ var require_md049_md050 = __commonJS({
10216
10200
  var require_md051 = __commonJS({
10217
10201
  "node_modules/markdownlint/lib/md051.js"(exports, module2) {
10218
10202
  "use strict";
10219
- var { addError, addErrorDetailIf } = require_helpers2();
10220
- var { filterByHtmlTokens, filterByTypes, getHtmlTagInfo } = require_micromark2();
10221
- var idRe = /\sid\s*=\s*['"]?([^'"\s>]+)/iu;
10222
- var nameRe = /\sname\s*=\s*['"]?([^'"\s>]+)/iu;
10203
+ var { addError, addErrorDetailIf, getHtmlAttributeRe } = require_helpers2();
10204
+ var { filterByPredicate, filterByTypes, getHtmlTagInfo } = require_micromark2();
10205
+ var idRe = getHtmlAttributeRe("id");
10206
+ var nameRe = getHtmlAttributeRe("name");
10223
10207
  var anchorRe = /\{(#[a-z\d]+(?:[-_][a-z\d]+)*)\}/gu;
10208
+ var childrenExclude = /* @__PURE__ */ new Set(["image", "reference", "resource"]);
10209
+ var tokensInclude = /* @__PURE__ */ new Set(
10210
+ ["characterEscapeValue", "codeTextData", "data"]
10211
+ );
10224
10212
  function convertHeadingToHTMLFragment(headingText) {
10225
- const inlineText = filterByTypes(headingText.children, ["codeTextData", "data"]).map((token) => token.text).join("");
10213
+ const inlineText = filterByPredicate(
10214
+ headingText.children,
10215
+ (token) => tokensInclude.has(token.type),
10216
+ (token) => childrenExclude.has(token.type) ? [] : token.children
10217
+ ).map((token) => token.text).join("");
10226
10218
  return "#" + encodeURIComponent(
10227
10219
  inlineText.toLowerCase().replace(
10228
10220
  /[^\p{Letter}\p{Mark}\p{Number}\p{Connector_Punctuation}\- ]/gu,
@@ -10230,6 +10222,9 @@ var require_md051 = __commonJS({
10230
10222
  ).replace(/ /gu, "-")
10231
10223
  );
10232
10224
  }
10225
+ function unescapeStringTokenText(token) {
10226
+ return filterByTypes(token.children, ["characterEscapeValue", "data"]).map((child) => child.text).join("");
10227
+ }
10233
10228
  module2.exports = {
10234
10229
  "names": ["MD051", "link-fragments"],
10235
10230
  "description": "Link fragments should be valid",
@@ -10243,24 +10238,26 @@ var require_md051 = __commonJS({
10243
10238
  );
10244
10239
  for (const headingText of headingTexts) {
10245
10240
  const fragment = convertHeadingToHTMLFragment(headingText);
10246
- const count = fragments.get(fragment) || 0;
10247
- if (count) {
10248
- fragments.set(`${fragment}-${count}`, 0);
10249
- }
10250
- fragments.set(fragment, count + 1);
10251
- let match = null;
10252
- while ((match = anchorRe.exec(headingText.text)) !== null) {
10253
- const [, anchor] = match;
10254
- if (!fragments.has(anchor)) {
10255
- fragments.set(anchor, 1);
10241
+ if (fragment !== "#") {
10242
+ const count = fragments.get(fragment) || 0;
10243
+ if (count) {
10244
+ fragments.set(`${fragment}-${count}`, 0);
10245
+ }
10246
+ fragments.set(fragment, count + 1);
10247
+ let match = null;
10248
+ while ((match = anchorRe.exec(headingText.text)) !== null) {
10249
+ const [, anchor] = match;
10250
+ if (!fragments.has(anchor)) {
10251
+ fragments.set(anchor, 1);
10252
+ }
10256
10253
  }
10257
10254
  }
10258
10255
  }
10259
- for (const token of filterByHtmlTokens(tokens)) {
10256
+ for (const token of filterByTypes(tokens, ["htmlText"])) {
10260
10257
  const htmlTagInfo = getHtmlTagInfo(token);
10261
10258
  if (htmlTagInfo && !htmlTagInfo.close) {
10262
10259
  const anchorMatch = idRe.exec(token.text) || htmlTagInfo.name.toLowerCase() === "a" && nameRe.exec(token.text);
10263
- if (anchorMatch) {
10260
+ if (anchorMatch && anchorMatch.length > 0) {
10264
10261
  fragments.set(`#${anchorMatch[1]}`, 0);
10265
10262
  }
10266
10263
  }
@@ -10274,7 +10271,9 @@ var require_md051 = __commonJS({
10274
10271
  for (const link of links) {
10275
10272
  const definitions = filterByTypes(link.children, [definitionType]);
10276
10273
  for (const definition of definitions) {
10277
- if (definition.text.length > 1 && definition.text.startsWith("#") && !fragments.has(definition.text)) {
10274
+ const { endColumn, startColumn } = definition;
10275
+ const text = unescapeStringTokenText(definition);
10276
+ if (text.length > 1 && text.startsWith("#") && !fragments.has(text) && !fragments.has(`#${encodeURIComponent(text.slice(1))}`)) {
10278
10277
  let context = void 0;
10279
10278
  let range = void 0;
10280
10279
  let fixInfo = void 0;
@@ -10282,19 +10281,19 @@ var require_md051 = __commonJS({
10282
10281
  context = link.text;
10283
10282
  range = [link.startColumn, link.endColumn - link.startColumn];
10284
10283
  fixInfo = {
10285
- "editColumn": definition.startColumn,
10286
- "deleteCount": definition.endColumn - definition.startColumn
10284
+ "editColumn": startColumn,
10285
+ "deleteCount": endColumn - startColumn
10287
10286
  };
10288
10287
  }
10289
- const definitionTextLower = definition.text.toLowerCase();
10290
- const mixedCaseKey = [...fragments.keys()].find((key) => definitionTextLower === key.toLowerCase());
10288
+ const textLower = text.toLowerCase();
10289
+ const mixedCaseKey = [...fragments.keys()].find((key) => textLower === key.toLowerCase());
10291
10290
  if (mixedCaseKey) {
10292
10291
  (fixInfo || {}).insertText = mixedCaseKey;
10293
10292
  addErrorDetailIf(
10294
10293
  onError,
10295
10294
  link.startLine,
10296
10295
  mixedCaseKey,
10297
- definition.text,
10296
+ text,
10298
10297
  void 0,
10299
10298
  context,
10300
10299
  range,
@@ -10329,9 +10328,11 @@ var require_md052 = __commonJS({
10329
10328
  "description": "Reference links and images should use a label that is defined",
10330
10329
  "tags": ["images", "links"],
10331
10330
  "function": function MD052(params, onError) {
10332
- const { lines } = params;
10333
- const { references, definitions } = referenceLinkImageData();
10334
- for (const reference of references.entries()) {
10331
+ const { config: config2, lines } = params;
10332
+ const shortcutSyntax = config2.shortcut_syntax || false;
10333
+ const { definitions, references, shortcuts } = referenceLinkImageData();
10334
+ const entries = shortcutSyntax ? [...references.entries(), ...shortcuts.entries()] : references.entries();
10335
+ for (const reference of entries) {
10335
10336
  const [label, datas] = reference;
10336
10337
  if (!definitions.has(label)) {
10337
10338
  for (const data of datas) {
@@ -10371,7 +10372,7 @@ var require_md053 = __commonJS({
10371
10372
  "deleteCount": -1
10372
10373
  };
10373
10374
  for (const definition of definitions.entries()) {
10374
- const [label, lineIndex] = definition;
10375
+ const [label, [lineIndex]] = definition;
10375
10376
  if (!ignored.has(label) && !references.has(label) && !shortcuts.has(label)) {
10376
10377
  const line = lines[lineIndex];
10377
10378
  addError(
@@ -10403,6 +10404,118 @@ var require_md053 = __commonJS({
10403
10404
  }
10404
10405
  });
10405
10406
 
10407
+ // node_modules/markdownlint/lib/md054.js
10408
+ var require_md054 = __commonJS({
10409
+ "node_modules/markdownlint/lib/md054.js"(exports, module2) {
10410
+ "use strict";
10411
+ var { addErrorContext, nextLinesRe } = require_helpers2();
10412
+ var { filterByTypes, filterByPredicate, getTokenTextByType } = require_micromark2();
10413
+ var { referenceLinkImageData } = require_cache();
10414
+ var backslashEscapeRe = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g;
10415
+ var removeBackslashEscapes = (text) => text.replace(backslashEscapeRe, "$1");
10416
+ var autolinkDisallowedRe = /[ <>]/;
10417
+ var autolinkAble = (destination) => {
10418
+ try {
10419
+ new URL(destination);
10420
+ } catch {
10421
+ return false;
10422
+ }
10423
+ return !autolinkDisallowedRe.test(destination);
10424
+ };
10425
+ module2.exports = {
10426
+ "names": ["MD054", "link-image-style"],
10427
+ "description": "Link and image style",
10428
+ "tags": ["images", "links"],
10429
+ "function": (params, onError) => {
10430
+ const { parsers, config: config2 } = params;
10431
+ const autolink = config2.autolink === void 0 || !!config2.autolink;
10432
+ const inline = config2.inline === void 0 || !!config2.inline;
10433
+ const full = config2.full === void 0 || !!config2.full;
10434
+ const collapsed = config2.collapsed === void 0 || !!config2.collapsed;
10435
+ const shortcut = config2.shortcut === void 0 || !!config2.shortcut;
10436
+ const urlInline = config2.url_inline === void 0 || !!config2.url_inline;
10437
+ if (autolink && inline && full && collapsed && shortcut && urlInline) {
10438
+ return;
10439
+ }
10440
+ const { definitions } = referenceLinkImageData();
10441
+ const links = filterByTypes(
10442
+ parsers.micromark.tokens,
10443
+ ["autolink", "image", "link"]
10444
+ );
10445
+ for (const link of links) {
10446
+ let label = null;
10447
+ let destination = null;
10448
+ const {
10449
+ children,
10450
+ endColumn,
10451
+ endLine,
10452
+ startColumn,
10453
+ startLine,
10454
+ text,
10455
+ type: type2
10456
+ } = link;
10457
+ const image = type2 === "image";
10458
+ let isError = false;
10459
+ if (type2 === "autolink") {
10460
+ destination = getTokenTextByType(children, "autolinkProtocol");
10461
+ label = destination;
10462
+ isError = !autolink;
10463
+ } else {
10464
+ const descendents = filterByPredicate(children);
10465
+ label = getTokenTextByType(descendents, "labelText");
10466
+ destination = getTokenTextByType(descendents, "resourceDestinationString");
10467
+ if (destination) {
10468
+ const title = getTokenTextByType(descendents, "resourceTitleString");
10469
+ isError = !inline || !urlInline && autolink && !title && !image;
10470
+ } else {
10471
+ const isShortcut = !children.some((t) => t.type === "reference");
10472
+ const referenceString = getTokenTextByType(descendents, "referenceString");
10473
+ const isCollapsed = referenceString === null;
10474
+ const definition = definitions.get(referenceString || label);
10475
+ destination = definition && definition[1];
10476
+ isError = destination && (isShortcut ? !shortcut : isCollapsed ? !collapsed : !full);
10477
+ }
10478
+ }
10479
+ if (isError) {
10480
+ let range = null;
10481
+ let fixInfo = null;
10482
+ if (startLine === endLine) {
10483
+ range = [startColumn, endColumn - startColumn];
10484
+ let insertText = null;
10485
+ const canInline = inline && label;
10486
+ const canAutolink = autolink && !image && autolinkAble(destination);
10487
+ if (canInline && (urlInline || !canAutolink)) {
10488
+ const prefix = image ? "!" : "";
10489
+ const escapedLabel = label.replace(/[[\]]/g, "\\$&");
10490
+ const escapedDestination = destination.replace(/[()]/g, "\\$&");
10491
+ insertText = `${prefix}[${escapedLabel}](${escapedDestination})`;
10492
+ } else if (canAutolink) {
10493
+ insertText = `<${removeBackslashEscapes(destination)}>`;
10494
+ }
10495
+ if (insertText) {
10496
+ fixInfo = {
10497
+ "editColumn": range[0],
10498
+ insertText,
10499
+ "deleteCount": range[1]
10500
+ };
10501
+ }
10502
+ }
10503
+ addErrorContext(
10504
+ onError,
10505
+ startLine,
10506
+ text.replace(nextLinesRe, ""),
10507
+ null,
10508
+ null,
10509
+ range,
10510
+ fixInfo
10511
+ );
10512
+ }
10513
+ }
10514
+ }
10515
+ };
10516
+ }
10517
+ });
10518
+
10406
10519
  // node_modules/markdownlint/lib/rules.js
10407
10520
  var require_rules = __commonJS({
10408
10521
  "node_modules/markdownlint/lib/rules.js"(exports, module2) {
@@ -10410,11 +10523,9 @@ var require_rules = __commonJS({
10410
10523
  var { homepage, version } = require_constants();
10411
10524
  var rules = [
10412
10525
  require_md001(),
10413
- require_md002(),
10414
10526
  require_md003(),
10415
10527
  require_md004(),
10416
10528
  require_md005(),
10417
- require_md006(),
10418
10529
  require_md007(),
10419
10530
  require_md009(),
10420
10531
  require_md010(),
@@ -10456,7 +10567,11 @@ var require_rules = __commonJS({
10456
10567
  ...require_md049_md050(),
10457
10568
  require_md051(),
10458
10569
  require_md052(),
10459
- require_md053()
10570
+ require_md053(),
10571
+ require_md054()
10572
+ // md055: See https://github.com/markdownlint/markdownlint
10573
+ // md056: See https://github.com/markdownlint/markdownlint
10574
+ // md057: See https://github.com/markdownlint/markdownlint
10460
10575
  ];
10461
10576
  for (const rule of rules) {
10462
10577
  const name = rule.names[0].toLowerCase();
@@ -10470,11 +10585,10 @@ var require_rules = __commonJS({
10470
10585
  var require_markdownlint = __commonJS({
10471
10586
  "node_modules/markdownlint/lib/markdownlint.js"(exports, module2) {
10472
10587
  "use strict";
10473
- var path2 = require("path");
10474
- var { promisify } = require("util");
10588
+ var path2 = require("node:path");
10589
+ var { promisify } = require("node:util");
10475
10590
  var markdownit = require_markdown_it();
10476
10591
  var micromark = require_micromark2();
10477
- var { deprecatedRuleNames } = require_constants();
10478
10592
  var rules = require_rules();
10479
10593
  var helpers = require_helpers2();
10480
10594
  var cache = require_cache();
@@ -10685,9 +10799,6 @@ var require_markdownlint = __commonJS({
10685
10799
  const ruleName = rule.names[0].toUpperCase();
10686
10800
  effectiveConfig[ruleName] = ruleDefault;
10687
10801
  }
10688
- for (const ruleName of deprecatedRuleNames) {
10689
- effectiveConfig[ruleName] = false;
10690
- }
10691
10802
  for (const key of Object.keys(config2)) {
10692
10803
  let value = config2[key];
10693
10804
  if (value) {
@@ -10880,7 +10991,7 @@ var require_markdownlint = __commonJS({
10880
10991
  };
10881
10992
  function throwError2(property) {
10882
10993
  throw new Error(
10883
- "Property '" + property + "' of onError parameter is incorrect."
10994
+ `Value of '${property}' passed to onError by '${ruleName}' is incorrect for '${name}'.`
10884
10995
  );
10885
10996
  }
10886
10997
  function onError(errorInfo) {
@@ -11085,7 +11196,7 @@ var require_markdownlint = __commonJS({
11085
11196
  for (const plugin of markdownItPlugins) {
11086
11197
  md.use(...plugin);
11087
11198
  }
11088
- const fs2 = options.fs || require("fs");
11199
+ const fs2 = options.fs || require("node:fs");
11089
11200
  const aliasToRuleNames = mapAliasToRuleNames(ruleList);
11090
11201
  const results = newResults(ruleList);
11091
11202
  let done = false;
@@ -11168,7 +11279,7 @@ var require_markdownlint = __commonJS({
11168
11279
  return markdownlintPromisify(options);
11169
11280
  }
11170
11281
  function markdownlintSync(options) {
11171
- let results = {};
11282
+ let results = null;
11172
11283
  lintInput(options, true, function callback(error, res) {
11173
11284
  if (error) {
11174
11285
  throw error;
@@ -11215,7 +11326,7 @@ var require_markdownlint = __commonJS({
11215
11326
  if (configExtends) {
11216
11327
  return resolveConfigExtends(
11217
11328
  file,
11218
- helpers.expandTildePath(configExtends, require("os")),
11329
+ helpers.expandTildePath(configExtends, require("node:os")),
11219
11330
  fs2,
11220
11331
  // eslint-disable-next-line no-use-before-define
11221
11332
  (_, resolvedExtends) => readConfig(
@@ -11254,9 +11365,9 @@ var require_markdownlint = __commonJS({
11254
11365
  }
11255
11366
  }
11256
11367
  if (!fs2) {
11257
- fs2 = require("fs");
11368
+ fs2 = require("node:fs");
11258
11369
  }
11259
- file = helpers.expandTildePath(file, require("os"));
11370
+ file = helpers.expandTildePath(file, require("node:os"));
11260
11371
  fs2.readFile(file, "utf8", (err, content) => {
11261
11372
  if (err) {
11262
11373
  return callback(err);
@@ -11274,9 +11385,9 @@ var require_markdownlint = __commonJS({
11274
11385
  }
11275
11386
  function readConfigSync2(file, parsers, fs2) {
11276
11387
  if (!fs2) {
11277
- fs2 = require("fs");
11388
+ fs2 = require("node:fs");
11278
11389
  }
11279
- const os = require("os");
11390
+ const os = require("node:os");
11280
11391
  file = helpers.expandTildePath(file, os);
11281
11392
  const content = fs2.readFileSync(file, "utf8");
11282
11393
  const { config: config2, message } = parseConfiguration(file, content, parsers);
@@ -12933,6 +13044,7 @@ var require_shared2 = __commonJS({
12933
13044
  "node_modules/markdownlint-rule-helpers/shared.js"(exports, module2) {
12934
13045
  "use strict";
12935
13046
  module2.exports.newLineRe = /\r\n?|\n/g;
13047
+ module2.exports.nextLinesRe = /[\r\n][\s\S]*$/;
12936
13048
  }
12937
13049
  });
12938
13050
 
@@ -12951,6 +13063,15 @@ var require_micromark4 = __commonJS({
12951
13063
  // @ts-ignore
12952
13064
  } = require_micromark3();
12953
13065
  var { newLineRe } = require_shared2();
13066
+ var flatTokensSymbol = Symbol("flat-tokens");
13067
+ function isHtmlFlowComment(token) {
13068
+ const { text, type: type2 } = token;
13069
+ if (type2 === "htmlFlow" && text.startsWith("<!--") && text.endsWith("-->")) {
13070
+ const comment = text.slice(4, -3);
13071
+ return !comment.startsWith(">") && !comment.startsWith("->") && !comment.endsWith("-");
13072
+ }
13073
+ return false;
13074
+ }
12954
13075
  function getMicromarkEvents(markdown, micromarkOptions = {}, referencesDefined = true) {
12955
13076
  micromarkOptions.extensions = micromarkOptions.extensions || [];
12956
13077
  micromarkOptions.extensions.push(
@@ -12969,26 +13090,36 @@ var require_micromark4 = __commonJS({
12969
13090
  const events = postprocess(parseContext.document().write(chunks));
12970
13091
  return events;
12971
13092
  }
12972
- function micromarkParseWithOffset(markdown, micromarkOptions, referencesDefined, lineDelta) {
13093
+ function micromarkParseWithOffset(markdown, micromarkOptions, referencesDefined, lineDelta, ancestor) {
12973
13094
  const events = getMicromarkEvents(
12974
13095
  markdown,
12975
13096
  micromarkOptions,
12976
13097
  referencesDefined
12977
13098
  );
12978
13099
  const document = [];
12979
- let current = {
12980
- "children": document
13100
+ let flatTokens = [];
13101
+ const root = {
13102
+ "type": "ROOT",
13103
+ "startLine": -1,
13104
+ "startColumn": -1,
13105
+ "endLine": -1,
13106
+ "endColumn": -1,
13107
+ "text": "ROOT",
13108
+ "children": document,
13109
+ "parent": null
12981
13110
  };
12982
- const history = [current];
13111
+ const history = [root];
13112
+ let current = root;
12983
13113
  let reparseOptions = null;
12984
13114
  let lines = null;
13115
+ let skipHtmlFlowChildren = false;
12985
13116
  for (const event of events) {
12986
13117
  const [kind, token, context] = event;
12987
13118
  const { type: type2, start, end } = token;
12988
13119
  const { "column": startColumn, "line": startLine } = start;
12989
13120
  const { "column": endColumn, "line": endLine } = end;
12990
13121
  const text = context.sliceSerialize(token);
12991
- if (kind === "enter") {
13122
+ if (kind === "enter" && !skipHtmlFlowChildren) {
12992
13123
  const previous = current;
12993
13124
  history.push(previous);
12994
13125
  current = {
@@ -12998,9 +13129,13 @@ var require_micromark4 = __commonJS({
12998
13129
  "endLine": endLine + lineDelta,
12999
13130
  endColumn,
13000
13131
  text,
13001
- "children": []
13132
+ "children": [],
13133
+ "parent": previous === root ? ancestor || null : previous
13002
13134
  };
13003
- if (current.type === "htmlFlow") {
13135
+ previous.children.push(current);
13136
+ flatTokens.push(current);
13137
+ if (current.type === "htmlFlow" && !isHtmlFlowComment(current)) {
13138
+ skipHtmlFlowChildren = true;
13004
13139
  if (!reparseOptions || !lines) {
13005
13140
  reparseOptions = {
13006
13141
  ...micromarkOptions,
@@ -13015,20 +13150,28 @@ var require_micromark4 = __commonJS({
13015
13150
  lines = markdown.split(newLineRe);
13016
13151
  }
13017
13152
  const reparseMarkdown = lines.slice(current.startLine - 1, current.endLine).join("\n");
13018
- current.htmlFlowChildren = micromarkParseWithOffset(
13153
+ const tokens = micromarkParseWithOffset(
13019
13154
  reparseMarkdown,
13020
13155
  reparseOptions,
13021
13156
  referencesDefined,
13022
- current.startLine - 1
13157
+ current.startLine - 1,
13158
+ current
13023
13159
  );
13160
+ current.children = tokens;
13161
+ flatTokens = flatTokens.concat(tokens[flatTokensSymbol]);
13024
13162
  }
13025
- previous.children.push(current);
13026
13163
  } else if (kind === "exit") {
13027
- Object.freeze(current.children);
13028
- Object.freeze(current);
13029
- current = history.pop();
13164
+ if (type2 === "htmlFlow") {
13165
+ skipHtmlFlowChildren = false;
13166
+ }
13167
+ if (!skipHtmlFlowChildren) {
13168
+ Object.freeze(current.children);
13169
+ Object.freeze(current);
13170
+ current = history.pop();
13171
+ }
13030
13172
  }
13031
13173
  }
13174
+ Object.defineProperty(document, flatTokensSymbol, { "value": flatTokens });
13032
13175
  Object.freeze(document);
13033
13176
  return document;
13034
13177
  }
@@ -13041,50 +13184,45 @@ var require_micromark4 = __commonJS({
13041
13184
  );
13042
13185
  }
13043
13186
  function filterByPredicate(tokens, allowed, transformChildren) {
13187
+ allowed = allowed || (() => true);
13044
13188
  const result = [];
13045
- const pending = [...tokens];
13046
- let token = null;
13047
- while (token = pending.shift()) {
13048
- if (allowed(token)) {
13049
- result.push(token);
13050
- }
13051
- if (token.children.length > 0) {
13052
- const transformed = transformChildren ? transformChildren(token) : token.children;
13053
- pending.unshift(...transformed);
13189
+ const queue = [
13190
+ {
13191
+ "array": tokens,
13192
+ "index": 0
13054
13193
  }
13055
- }
13056
- return result;
13057
- }
13058
- function filterByTypes(tokens, allowed) {
13059
- return filterByPredicate(
13060
- tokens,
13061
- (token) => allowed.includes(token.type)
13062
- );
13063
- }
13064
- function filterByHtmlTokens(tokens) {
13065
- const result = [];
13066
- const pending = [tokens];
13067
- let current = null;
13068
- while (current = pending.shift()) {
13069
- for (const token of filterByTypes(current, ["htmlFlow", "htmlText"])) {
13070
- if (token.type === "htmlText") {
13194
+ ];
13195
+ while (queue.length > 0) {
13196
+ const current = queue[queue.length - 1];
13197
+ const { array, index } = current;
13198
+ if (index < array.length) {
13199
+ const token = array[current.index++];
13200
+ if (allowed(token)) {
13071
13201
  result.push(token);
13072
- } else {
13073
- pending.push(token.htmlFlowChildren);
13074
13202
  }
13203
+ const { children } = token;
13204
+ if (children.length > 0) {
13205
+ const transformed = transformChildren ? transformChildren(token) : children;
13206
+ queue.push(
13207
+ {
13208
+ "array": transformed,
13209
+ "index": 0
13210
+ }
13211
+ );
13212
+ }
13213
+ } else {
13214
+ queue.pop();
13075
13215
  }
13076
13216
  }
13077
13217
  return result;
13078
13218
  }
13079
- function flattenedChildren(parent) {
13080
- const result = [];
13081
- const pending = [...parent.children];
13082
- let token = null;
13083
- while (token = pending.shift()) {
13084
- result.push(token);
13085
- pending.unshift(...token.children);
13219
+ function filterByTypes(tokens, types2) {
13220
+ const predicate = (token) => types2.includes(token.type);
13221
+ const flatTokens = tokens[flatTokensSymbol];
13222
+ if (flatTokens) {
13223
+ return flatTokens.filter(predicate);
13086
13224
  }
13087
- return result;
13225
+ return filterByPredicate(tokens, predicate);
13088
13226
  }
13089
13227
  function getHeadingLevel(heading) {
13090
13228
  const headingSequence = filterByTypes(
@@ -13115,9 +13253,18 @@ var require_micromark4 = __commonJS({
13115
13253
  }
13116
13254
  return null;
13117
13255
  }
13256
+ function getTokenParentOfType(token, types2) {
13257
+ let current = token;
13258
+ while ((current = current.parent) && !types2.includes(current.type)) {
13259
+ }
13260
+ return current;
13261
+ }
13118
13262
  function getTokenTextByType(tokens, type2) {
13119
13263
  const filtered = tokens.filter((token) => token.type === type2);
13120
- return filtered.length === 1 ? filtered[0].text : null;
13264
+ return filtered.length > 0 ? filtered[0].text : null;
13265
+ }
13266
+ function inHtmlFlow(token) {
13267
+ return getTokenParentOfType(token, ["htmlFlow"]) !== null;
13121
13268
  }
13122
13269
  function matchAndGetTokensByType(tokens, matchTypes, resultTypes) {
13123
13270
  if (tokens.length !== matchTypes.length) {
@@ -13139,14 +13286,14 @@ var require_micromark4 = __commonJS({
13139
13286
  }
13140
13287
  module2.exports = {
13141
13288
  "parse": micromarkParse,
13142
- filterByHtmlTokens,
13143
13289
  filterByPredicate,
13144
13290
  filterByTypes,
13145
- flattenedChildren,
13146
13291
  getHeadingLevel,
13147
13292
  getHtmlTagInfo,
13148
13293
  getMicromarkEvents,
13294
+ getTokenParentOfType,
13149
13295
  getTokenTextByType,
13296
+ inHtmlFlow,
13150
13297
  matchAndGetTokensByType,
13151
13298
  tokenIfType
13152
13299
  };
@@ -13158,14 +13305,11 @@ var require_helpers3 = __commonJS({
13158
13305
  "node_modules/markdownlint-rule-helpers/helpers.js"(exports, module2) {
13159
13306
  "use strict";
13160
13307
  var micromark = require_micromark4();
13161
- var { newLineRe } = require_shared2();
13308
+ var { newLineRe, nextLinesRe } = require_shared2();
13162
13309
  module2.exports.newLineRe = newLineRe;
13163
- module2.exports.frontMatterRe = // eslint-disable-next-line max-len
13164
- /((^---\s*$[\s\S]*?^---\s*)|(^\+\+\+\s*$[\s\S]*?^(\+\+\+|\.\.\.)\s*)|(^\{\s*$[\s\S]*?^\}\s*))(\r\n|\r|\n|$)/m;
13165
- var inlineCommentStartRe = (
13166
- // eslint-disable-next-line max-len
13167
- /(<!--\s*markdownlint-(disable|enable|capture|restore|disable-file|enable-file|disable-line|disable-next-line|configure-file))(?:\s|-->)/gi
13168
- );
13310
+ module2.exports.nextLinesRe = nextLinesRe;
13311
+ module2.exports.frontMatterRe = /((^---\s*$[\s\S]+?^---\s*)|(^\+\+\+\s*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{\s*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m;
13312
+ var inlineCommentStartRe = /(<!--\s*markdownlint-(disable|enable|capture|restore|disable-file|enable-file|disable-line|disable-next-line|configure-file))(?:\s|-->)/gi;
13169
13313
  module2.exports.inlineCommentStartRe = inlineCommentStartRe;
13170
13314
  module2.exports.listItemMarkerRe = /^([\s>]*)(?:[*+-]|\d+[.)])\s+/;
13171
13315
  module2.exports.orderedListItemMarkerRe = /^[\s>]*0*(\d+)[.)]/;
@@ -13173,10 +13317,8 @@ var require_helpers3 = __commonJS({
13173
13317
  module2.exports.blockquotePrefixRe = blockquotePrefixRe;
13174
13318
  var linkReferenceDefinitionRe = /^ {0,3}\[([^\]]*[^\\])\]:/;
13175
13319
  module2.exports.linkReferenceDefinitionRe = linkReferenceDefinitionRe;
13176
- module2.exports.endOfLineHtmlEntityRe = // eslint-disable-next-line max-len
13177
- /&(?:#\d+|#[xX][\da-fA-F]+|[a-zA-Z]{2,31}|blk\d{2}|emsp1[34]|frac\d{2}|sup\d|there4);$/;
13178
- module2.exports.endOfLineGemojiCodeRe = // eslint-disable-next-line max-len
13179
- /:(?:[abmovx]|[-+]1|100|1234|(?:1st|2nd|3rd)_place_medal|8ball|clock\d{1,4}|e-mail|non-potable_water|o2|t-rex|u5272|u5408|u55b6|u6307|u6708|u6709|u6e80|u7121|u7533|u7981|u7a7a|[a-z]{2,15}2?|[a-z]{1,14}(?:_[a-z\d]{1,16})+):$/;
13320
+ module2.exports.endOfLineHtmlEntityRe = /&(?:#\d+|#[xX][\da-fA-F]+|[a-zA-Z]{2,31}|blk\d{2}|emsp1[34]|frac\d{2}|sup\d|there4);$/;
13321
+ module2.exports.endOfLineGemojiCodeRe = /:(?:[abmovx]|[-+]1|100|1234|(?:1st|2nd|3rd)_place_medal|8ball|clock\d{1,4}|e-mail|non-potable_water|o2|t-rex|u5272|u5408|u55b6|u6307|u6708|u6709|u6e80|u7121|u7533|u7981|u7a7a|[a-z]{2,15}2?|[a-z]{1,14}(?:_[a-z\d]{1,16})+):$/;
13180
13322
  var allPunctuation = ".,;:!?\u3002\uFF0C\uFF1B\uFF1A\uFF01\uFF1F";
13181
13323
  module2.exports.allPunctuation = allPunctuation;
13182
13324
  module2.exports.allPunctuationNoQuestion = allPunctuation.replace(/[??]/gu, "");
@@ -13208,6 +13350,9 @@ var require_helpers3 = __commonJS({
13208
13350
  return isUrl(url) ? new URL(url) : url;
13209
13351
  }
13210
13352
  module2.exports.cloneIfUrl = cloneIfUrl;
13353
+ module2.exports.getHtmlAttributeRe = function getHtmlAttributeRe(name) {
13354
+ return new RegExp(`\\s${name}\\s*=\\s*['"]?([^'"\\s>]*)`, "iu");
13355
+ };
13211
13356
  function isBlankLine(line) {
13212
13357
  const startComment = "<!--";
13213
13358
  const endComment = "-->";
@@ -13330,7 +13475,7 @@ var require_helpers3 = __commonJS({
13330
13475
  }
13331
13476
  }
13332
13477
  module2.exports.filterTokens = filterTokens;
13333
- module2.exports.getLineMetadata = function getLineMetadata(params) {
13478
+ function getLineMetadata(params) {
13334
13479
  const lineMetadata = params.lines.map(
13335
13480
  (line, index) => [line, index, false, 0, false, false, false]
13336
13481
  );
@@ -13362,7 +13507,8 @@ var require_helpers3 = __commonJS({
13362
13507
  lineMetadata[token.map[0]][6] = true;
13363
13508
  });
13364
13509
  return lineMetadata;
13365
- };
13510
+ }
13511
+ module2.exports.getLineMetadata = getLineMetadata;
13366
13512
  function forEachLine(lineMetadata, handler) {
13367
13513
  for (const metadata of lineMetadata) {
13368
13514
  handler(...metadata);
@@ -13590,7 +13736,18 @@ var require_helpers3 = __commonJS({
13590
13736
  if (definitions.has(reference)) {
13591
13737
  duplicateDefinitions.push([reference, token.startLine - 1]);
13592
13738
  } else {
13593
- definitions.set(reference, token.startLine - 1);
13739
+ let destinationString = null;
13740
+ const parent = micromark.getTokenParentOfType(token, ["definition"]);
13741
+ if (parent) {
13742
+ destinationString = micromark.getTokenTextByType(
13743
+ micromark.filterByPredicate(parent.children),
13744
+ "definitionDestinationString"
13745
+ );
13746
+ }
13747
+ definitions.set(
13748
+ reference,
13749
+ [token.startLine - 1, destinationString]
13750
+ );
13594
13751
  }
13595
13752
  }
13596
13753
  break;
@@ -13715,7 +13872,7 @@ var require_helpers3 = __commonJS({
13715
13872
  }
13716
13873
  module2.exports.applyFix = applyFix2;
13717
13874
  function applyFixes2(input, errors) {
13718
- const lineEnding = getPreferredLineEnding(input, require("os"));
13875
+ const lineEnding = getPreferredLineEnding(input, require("node:os"));
13719
13876
  const lines = input.split(newLineRe);
13720
13877
  let fixInfos = errors.filter((error) => error.fixInfo).map((error) => normalizeFixInfo(error.fixInfo, error.lineNumber));
13721
13878
  fixInfos.sort((a, b) => {
@@ -17180,11 +17337,11 @@ var MarkdownlintEngine = class {
17180
17337
  return;
17181
17338
  }
17182
17339
  const diagnostics = [];
17183
- results.forEach((result) => {
17340
+ for (const result of results) {
17184
17341
  const ruleDescription = result.ruleDescription;
17185
- let message = result.ruleNames.join("/") + ": " + ruleDescription;
17342
+ let message = `${result.ruleNames.join("/")}: ${ruleDescription}`;
17186
17343
  if (result.errorDetail) {
17187
- message += " [" + result.errorDetail + "]";
17344
+ message += ` [${result.errorDetail}]`;
17188
17345
  }
17189
17346
  const start = import_coc.Position.create(result.lineNumber - 1, 0);
17190
17347
  const end = import_coc.Position.create(result.lineNumber - 1, 0);
@@ -17198,7 +17355,7 @@ var MarkdownlintEngine = class {
17198
17355
  diagnostic.source = this.source;
17199
17356
  diagnostic.fixInfo = result.fixInfo;
17200
17357
  diagnostics.push(diagnostic);
17201
- });
17358
+ }
17202
17359
  this.diagnosticCollection.set(document.uri, diagnostics);
17203
17360
  }
17204
17361
  async fixAll(document) {
@@ -17208,7 +17365,7 @@ var MarkdownlintEngine = class {
17208
17365
  }
17209
17366
  const text = document.getText();
17210
17367
  const fixedText = (0, import_markdownlint_rule_helpers.applyFixes)(text, results);
17211
- if (text != fixedText) {
17368
+ if (text !== fixedText) {
17212
17369
  const doc = import_coc.workspace.getDocument(document.uri);
17213
17370
  const end = import_coc.Position.create(doc.lineCount - 1, doc.getline(doc.lineCount - 1).length);
17214
17371
  const edit = {