@meridianlabs/log-viewer 0.3.283 → 0.3.284

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.
@@ -1742,8 +1742,8 @@ var punycode = {
1742
1742
  "toUnicode": toUnicode
1743
1743
  };
1744
1744
  //#endregion
1745
- //#region ../../node_modules/.pnpm/markdown-it@15.0.2/node_modules/markdown-it/dist/markdown-it.mjs
1746
- /*! markdown-it 15.0.2 https://github.com/markdown-it/markdown-it @license MIT */
1745
+ //#region ../../node_modules/.pnpm/markdown-it@15.0.3/node_modules/markdown-it/dist/markdown-it.mjs
1746
+ /*! markdown-it 15.0.3 https://github.com/markdown-it/markdown-it @license MIT */
1747
1747
  var __defProp = Object.defineProperty;
1748
1748
  var __exportAll = (all, no_symbols) => {
1749
1749
  let target = {};
@@ -3105,12 +3105,14 @@ var StateBlock = class {
3105
3105
  const s = this.src;
3106
3106
  for (let start = 0, pos = 0, indent = 0, offset = 0, len = s.length, indent_found = false; pos < len; pos++) {
3107
3107
  const ch = s.charCodeAt(pos);
3108
- if (!indent_found) if (isSpace(ch)) {
3109
- indent++;
3110
- if (ch === 9) offset += 4 - offset % 4;
3111
- else offset++;
3112
- continue;
3113
- } else indent_found = true;
3108
+ if (!indent_found) {
3109
+ if (isSpace(ch)) {
3110
+ indent++;
3111
+ if (ch === 9) offset += 4 - offset % 4;
3112
+ else offset++;
3113
+ continue;
3114
+ } else indent_found = true;
3115
+ }
3114
3116
  if (ch === 10 || pos === len - 1) {
3115
3117
  if (ch !== 10) pos++;
3116
3118
  this.bMarks.push(start);
@@ -3177,9 +3179,10 @@ var StateBlock = class {
3177
3179
  else last = this.eMarks[line];
3178
3180
  while (first < last && lineIndent < indent) {
3179
3181
  const ch = this.src.charCodeAt(first);
3180
- if (isSpace(ch)) if (ch === 9) lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;
3181
- else lineIndent++;
3182
- else if (first - lineStart < this.tShift[line]) lineIndent++;
3182
+ if (isSpace(ch)) {
3183
+ if (ch === 9) lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;
3184
+ else lineIndent++;
3185
+ } else if (first - lineStart < this.tShift[line]) lineIndent++;
3183
3186
  else break;
3184
3187
  first++;
3185
3188
  }
@@ -3204,13 +3207,15 @@ function escapedSplit(str) {
3204
3207
  let lastPos = 0;
3205
3208
  let current = "";
3206
3209
  while (pos < max) {
3207
- if (ch === 124) if (!isEscaped) {
3208
- result.push(current + str.substring(lastPos, pos));
3209
- current = "";
3210
- lastPos = pos + 1;
3211
- } else {
3212
- current += str.substring(lastPos, pos - 1);
3213
- lastPos = pos;
3210
+ if (ch === 124) {
3211
+ if (!isEscaped) {
3212
+ result.push(current + str.substring(lastPos, pos));
3213
+ current = "";
3214
+ lastPos = pos + 1;
3215
+ } else {
3216
+ current += str.substring(lastPos, pos - 1);
3217
+ lastPos = pos;
3218
+ }
3214
3219
  }
3215
3220
  isEscaped = ch === 92;
3216
3221
  pos++;
@@ -3242,8 +3247,10 @@ function table(state, startLine, endLine, silent) {
3242
3247
  const aligns = [];
3243
3248
  for (let i = 0; i < columns.length; i++) {
3244
3249
  const t = columns[i].trim();
3245
- if (!t) if (i === 0 || i === columns.length - 1) continue;
3246
- else return false;
3250
+ if (!t) {
3251
+ if (i === 0 || i === columns.length - 1) continue;
3252
+ else return false;
3253
+ }
3247
3254
  if (!/^:?-+:?$/.test(t)) return false;
3248
3255
  if (t.charCodeAt(t.length - 1) === 58) aligns.push(t.charCodeAt(0) === 58 ? "center" : "right");
3249
3256
  else if (t.charCodeAt(0) === 58) aligns.push("left");
@@ -3430,9 +3437,10 @@ function blockquote(state, startLine, endLine, silent) {
3430
3437
  state.bMarks[nextLine] = pos;
3431
3438
  while (pos < max) {
3432
3439
  const ch = state.src.charCodeAt(pos);
3433
- if (isSpace(ch)) if (ch === 9) offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
3434
- else offset++;
3435
- else break;
3440
+ if (isSpace(ch)) {
3441
+ if (ch === 9) offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
3442
+ else offset++;
3443
+ } else break;
3436
3444
  pos++;
3437
3445
  }
3438
3446
  lastLineEmpty = pos >= max;
@@ -3659,129 +3667,141 @@ function list(state, startLine, endLine, silent) {
3659
3667
  if (tight) markTightParagraphs(state, listTokIdx);
3660
3668
  return true;
3661
3669
  }
3670
+ var MAX_LABEL_LENGTH = 999;
3671
+ function countCodePoints(str) {
3672
+ let length = str.length;
3673
+ for (let i = 0; i < str.length - 1; i++) {
3674
+ const high = str.charCodeAt(i);
3675
+ if (high < 55296 || high > 56319) continue;
3676
+ const low = str.charCodeAt(i + 1);
3677
+ if (low >= 56320 && low <= 57343) {
3678
+ length--;
3679
+ i++;
3680
+ }
3681
+ }
3682
+ return length;
3683
+ }
3684
+ function lineEnd(state, line) {
3685
+ return Math.min(state.eMarks[line] + 1, state.src.length);
3686
+ }
3687
+ function getNextLinePos(state, nextLine) {
3688
+ const endLine = state.lineMax;
3689
+ if (nextLine >= endLine || state.isEmpty(nextLine)) return -1;
3690
+ let isContinuation = false;
3691
+ if (state.sCount[nextLine] - state.blkIndent > 3) isContinuation = true;
3692
+ if (state.sCount[nextLine] < 0) isContinuation = true;
3693
+ if (!isContinuation) {
3694
+ const terminatorRules = state.md.block.ruler.getRules("reference");
3695
+ const oldParentType = state.parentType;
3696
+ state.parentType = "reference";
3697
+ let terminate = false;
3698
+ for (let i = 0, l = terminatorRules.length; i < l; i++) if (terminatorRules[i](state, nextLine, endLine, true)) {
3699
+ terminate = true;
3700
+ break;
3701
+ }
3702
+ state.parentType = oldParentType;
3703
+ if (terminate) return -1;
3704
+ }
3705
+ return state.bMarks[nextLine] + state.tShift[nextLine];
3706
+ }
3662
3707
  function reference(state, startLine, _endLine, silent) {
3708
+ const src = state.src;
3663
3709
  let pos = state.bMarks[startLine] + state.tShift[startLine];
3664
- let max = state.eMarks[startLine];
3665
3710
  let nextLine = startLine + 1;
3666
3711
  if (state.sCount[startLine] - state.blkIndent >= 4) return false;
3667
- if (state.src.charCodeAt(pos) !== 91) return false;
3668
- function getNextLine(nextLine) {
3669
- const endLine = state.lineMax;
3670
- if (nextLine >= endLine || state.isEmpty(nextLine)) return null;
3671
- let isContinuation = false;
3672
- if (state.sCount[nextLine] - state.blkIndent > 3) isContinuation = true;
3673
- if (state.sCount[nextLine] < 0) isContinuation = true;
3674
- if (!isContinuation) {
3675
- const terminatorRules = state.md.block.ruler.getRules("reference");
3676
- const oldParentType = state.parentType;
3677
- state.parentType = "reference";
3678
- let terminate = false;
3679
- for (let i = 0, l = terminatorRules.length; i < l; i++) if (terminatorRules[i](state, nextLine, endLine, true)) {
3680
- terminate = true;
3681
- break;
3682
- }
3683
- state.parentType = oldParentType;
3684
- if (terminate) return null;
3685
- }
3686
- const pos = state.bMarks[nextLine] + state.tShift[nextLine];
3687
- const max = state.eMarks[nextLine];
3688
- return state.src.slice(pos, max + 1);
3689
- }
3690
- let str = state.src.slice(pos, max + 1);
3691
- max = str.length;
3712
+ if (src.charCodeAt(pos) !== 91) return false;
3713
+ let max = lineEnd(state, startLine);
3714
+ let rawLabel = "";
3692
3715
  let labelEnd = -1;
3693
- for (pos = 1; pos < max; pos++) {
3694
- const ch = str.charCodeAt(pos);
3716
+ let segmentStart = ++pos;
3717
+ while (pos < max) {
3718
+ if (rawLabel.length + pos - segmentStart > MAX_LABEL_LENGTH * 2) return false;
3719
+ let ch = src.charCodeAt(pos);
3695
3720
  if (ch === 91) return false;
3696
- else if (ch === 93) {
3721
+ if (ch === 93) {
3697
3722
  labelEnd = pos;
3698
3723
  break;
3699
- } else if (ch === 10) {
3700
- const lineContent = getNextLine(nextLine);
3701
- if (lineContent !== null) {
3702
- str += lineContent;
3703
- max = str.length;
3704
- nextLine++;
3705
- }
3706
- } else if (ch === 92) {
3707
- pos++;
3708
- if (pos < max && str.charCodeAt(pos) === 10) {
3709
- const lineContent = getNextLine(nextLine);
3710
- if (lineContent !== null) {
3711
- str += lineContent;
3712
- max = str.length;
3713
- nextLine++;
3714
- }
3715
- }
3716
3724
  }
3725
+ if (ch === 92) ch = src.charCodeAt(++pos);
3726
+ if (ch === 10 && pos < max) {
3727
+ const nextPos = getNextLinePos(state, nextLine);
3728
+ if (nextPos < 0) return false;
3729
+ rawLabel += src.slice(segmentStart, max);
3730
+ pos = segmentStart = nextPos;
3731
+ max = lineEnd(state, nextLine++);
3732
+ continue;
3733
+ }
3734
+ pos++;
3717
3735
  }
3718
- if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 58) return false;
3719
- for (pos = labelEnd + 2; pos < max; pos++) {
3720
- const ch = str.charCodeAt(pos);
3736
+ if (labelEnd < 0 || src.charCodeAt(labelEnd + 1) !== 58) return false;
3737
+ rawLabel += src.slice(segmentStart, labelEnd);
3738
+ if (rawLabel.length > MAX_LABEL_LENGTH && countCodePoints(rawLabel) > MAX_LABEL_LENGTH) return false;
3739
+ pos = labelEnd + 2;
3740
+ while (pos < max) {
3741
+ const ch = src.charCodeAt(pos);
3721
3742
  if (ch === 10) {
3722
- const lineContent = getNextLine(nextLine);
3723
- if (lineContent !== null) {
3724
- str += lineContent;
3725
- max = str.length;
3726
- nextLine++;
3727
- }
3728
- } else if (isSpace(ch)) {} else break;
3729
- }
3730
- const destRes = state.md.helpers.parseLinkDestination(str, pos, max);
3743
+ const nextPos = getNextLinePos(state, nextLine);
3744
+ if (nextPos < 0) break;
3745
+ pos = nextPos;
3746
+ max = lineEnd(state, nextLine++);
3747
+ } else if (isSpace(ch)) pos++;
3748
+ else break;
3749
+ }
3750
+ const destRes = state.md.helpers.parseLinkDestination(src, pos, max);
3731
3751
  if (!destRes.ok) return false;
3732
3752
  const href = state.md.normalizeLink(destRes.str);
3733
3753
  if (!state.md.validateLink(href)) return false;
3734
3754
  pos = destRes.pos;
3735
3755
  const destEndPos = pos;
3756
+ const destEndMax = max;
3736
3757
  const destEndLineNo = nextLine;
3737
- const start = pos;
3738
- for (; pos < max; pos++) {
3739
- const ch = str.charCodeAt(pos);
3758
+ while (pos < max) {
3759
+ const ch = src.charCodeAt(pos);
3740
3760
  if (ch === 10) {
3741
- const lineContent = getNextLine(nextLine);
3742
- if (lineContent !== null) {
3743
- str += lineContent;
3744
- max = str.length;
3745
- nextLine++;
3746
- }
3747
- } else if (isSpace(ch)) {} else break;
3748
- }
3749
- let titleRes = state.md.helpers.parseLinkTitle(str, pos, max);
3761
+ const nextPos = getNextLinePos(state, nextLine);
3762
+ if (nextPos < 0) break;
3763
+ pos = nextPos;
3764
+ max = lineEnd(state, nextLine++);
3765
+ } else if (isSpace(ch)) pos++;
3766
+ else break;
3767
+ }
3768
+ const titleStart = pos;
3769
+ let titleRes = state.md.helpers.parseLinkTitle(src, pos, max);
3750
3770
  while (titleRes.can_continue) {
3751
- const lineContent = getNextLine(nextLine);
3752
- if (lineContent === null) break;
3753
- str += lineContent;
3754
- pos = max;
3755
- max = str.length;
3756
- nextLine++;
3757
- titleRes = state.md.helpers.parseLinkTitle(str, pos, max, titleRes);
3771
+ const nextPos = getNextLinePos(state, nextLine);
3772
+ if (nextPos < 0) break;
3773
+ pos = nextPos;
3774
+ max = lineEnd(state, nextLine++);
3775
+ titleRes = state.md.helpers.parseLinkTitle(src, pos, max, titleRes);
3758
3776
  }
3759
3777
  let title;
3760
- if (pos < max && start !== pos && titleRes.ok) {
3778
+ if (titleStart !== destEndPos && titleRes.ok) {
3761
3779
  title = titleRes.str;
3762
3780
  pos = titleRes.pos;
3763
3781
  } else {
3764
3782
  title = "";
3765
3783
  pos = destEndPos;
3784
+ max = destEndMax;
3766
3785
  nextLine = destEndLineNo;
3767
3786
  }
3768
3787
  while (pos < max) {
3769
- if (!isSpace(str.charCodeAt(pos))) break;
3788
+ if (!isSpace(src.charCodeAt(pos))) break;
3770
3789
  pos++;
3771
3790
  }
3772
- if (pos < max && str.charCodeAt(pos) !== 10) {
3791
+ if (pos < max && src.charCodeAt(pos) !== 10) {
3773
3792
  if (title) {
3774
3793
  title = "";
3775
3794
  pos = destEndPos;
3795
+ max = destEndMax;
3776
3796
  nextLine = destEndLineNo;
3777
3797
  while (pos < max) {
3778
- if (!isSpace(str.charCodeAt(pos))) break;
3798
+ if (!isSpace(src.charCodeAt(pos))) break;
3779
3799
  pos++;
3780
3800
  }
3781
3801
  }
3782
3802
  }
3783
- if (pos < max && str.charCodeAt(pos) !== 10) return false;
3784
- const label = normalizeReference(str.slice(1, labelEnd));
3803
+ if (pos < max && src.charCodeAt(pos) !== 10) return false;
3804
+ const label = normalizeReference(rawLabel);
3785
3805
  if (!label) return false;
3786
3806
  /* istanbul ignore if */
3787
3807
  if (silent) return true;
@@ -3865,7 +3885,7 @@ var html_blocks_default = [
3865
3885
  ];
3866
3886
  var open_tag = `<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`;
3867
3887
  var close_tag = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>";
3868
- var HTML_TAG_RE = new RegExp(`^(?:${open_tag}|${close_tag}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`);
3888
+ new RegExp(`^(?:${open_tag}|${close_tag}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`);
3869
3889
  var HTML_OPEN_CLOSE_TAG_RE = new RegExp(`^(?:${open_tag}|${close_tag})`);
3870
3890
  var HTML_SEQUENCES = [
3871
3891
  [
@@ -4179,6 +4199,7 @@ var StateInline = class {
4179
4199
  _defineProperty(this, "cache", {});
4180
4200
  _defineProperty(this, "backticks", {});
4181
4201
  _defineProperty(this, "backticksScanned", false);
4202
+ _defineProperty(this, "skipHtmlSpecial", false);
4182
4203
  _defineProperty(this, "linkLevel", 0);
4183
4204
  _defineProperty(this, "delimiters", []);
4184
4205
  _defineProperty(this, "_prev_delimiters", []);
@@ -4339,16 +4360,19 @@ function newline(state, silent) {
4339
4360
  if (state.src.charCodeAt(pos) !== 10) return false;
4340
4361
  const pmax = state.pending.length - 1;
4341
4362
  const max = state.posMax;
4342
- if (!silent) if (pmax >= 0 && state.pending.charCodeAt(pmax) === 32) if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 32) {
4343
- let ws = pmax - 1;
4344
- while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 32) ws--;
4345
- state.pending = state.pending.slice(0, ws);
4346
- state.push("hardbreak", "br", 0);
4347
- } else {
4348
- state.pending = state.pending.slice(0, -1);
4349
- state.push("softbreak", "br", 0);
4363
+ if (!silent) {
4364
+ if (pmax >= 0 && state.pending.charCodeAt(pmax) === 32) {
4365
+ if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 32) {
4366
+ let ws = pmax - 1;
4367
+ while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 32) ws--;
4368
+ state.pending = state.pending.slice(0, ws);
4369
+ state.push("hardbreak", "br", 0);
4370
+ } else {
4371
+ state.pending = state.pending.slice(0, -1);
4372
+ state.push("softbreak", "br", 0);
4373
+ }
4374
+ } else state.push("softbreak", "br", 0);
4350
4375
  }
4351
- else state.push("softbreak", "br", 0);
4352
4376
  pos++;
4353
4377
  while (pos < max && isSpace(state.src.charCodeAt(pos))) pos++;
4354
4378
  state.pos = pos;
@@ -4821,22 +4845,53 @@ function isLetter(ch) {
4821
4845
  const lc = ch | 32;
4822
4846
  return lc >= 97 && lc <= 122;
4823
4847
  }
4848
+ function scanSpecial(state, pos) {
4849
+ const src = state.src;
4850
+ let start;
4851
+ let terminator;
4852
+ if (src.startsWith("<!--", pos)) {
4853
+ if (src.startsWith(">", pos + 4)) return pos + 5;
4854
+ if (src.startsWith("->", pos + 4)) return pos + 6;
4855
+ start = pos + 4;
4856
+ terminator = "-->";
4857
+ } else if (src.startsWith("<![CDATA[", pos)) {
4858
+ start = pos + 9;
4859
+ terminator = "]]>";
4860
+ } else if (src.charCodeAt(pos + 1) === 63) {
4861
+ start = pos + 2;
4862
+ terminator = "?>";
4863
+ } else if (isLetter(src.charCodeAt(pos + 2))) {
4864
+ start = pos + 3;
4865
+ terminator = ">";
4866
+ } else return -1;
4867
+ if (state.skipHtmlSpecial) return -1;
4868
+ const end = src.indexOf(terminator, start);
4869
+ if (end < 0) {
4870
+ state.skipHtmlSpecial = true;
4871
+ return -1;
4872
+ }
4873
+ return end + terminator.length;
4874
+ }
4824
4875
  function html_inline(state, silent) {
4825
4876
  if (!state.md.options.html) return false;
4826
4877
  const max = state.posMax;
4827
4878
  const pos = state.pos;
4828
4879
  if (state.src.charCodeAt(pos) !== 60 || pos + 2 >= max) return false;
4880
+ let end;
4829
4881
  const ch = state.src.charCodeAt(pos + 1);
4830
- if (ch !== 33 && ch !== 63 && ch !== 47 && !isLetter(ch)) return false;
4831
- const match = state.src.slice(pos).match(HTML_TAG_RE);
4832
- if (!match) return false;
4882
+ if (ch === 33 || ch === 63) end = scanSpecial(state, pos);
4883
+ else if (ch === 47 || isLetter(ch)) {
4884
+ const match = state.src.slice(pos).match(HTML_OPEN_CLOSE_TAG_RE);
4885
+ end = match ? pos + match[0].length : -1;
4886
+ } else return false;
4887
+ if (end < 0) return false;
4833
4888
  if (!silent) {
4834
4889
  const token = state.push("html_inline", "", 0);
4835
- token.content = match[0];
4890
+ token.content = state.src.slice(pos, end);
4836
4891
  if (isLinkOpen(token.content)) state.linkLevel++;
4837
4892
  if (isLinkClose(token.content)) state.linkLevel--;
4838
4893
  }
4839
- state.pos += match[0].length;
4894
+ state.pos = end;
4840
4895
  return true;
4841
4896
  }
4842
4897
  var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;
@@ -8612,4 +8667,4 @@ var isSafeStyleValue = (property, value) => {
8612
8667
  //#endregion
8613
8668
  export { renderMarkdown, sanitizeRenderedHtml, truncateMarkdown };
8614
8669
 
8615
- //# sourceMappingURL=markdownPipeline-bhdCQvtQ.js.map
8670
+ //# sourceMappingURL=markdownPipeline-D23f-WkE.js.map