@mryhryki/markdown-preview 0.8.13 → 0.8.14

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mryhryki/markdown-preview",
3
3
  "description": "Markdown realtime preview on browser with your favorite editor",
4
- "version": "0.8.13",
4
+ "version": "0.8.14",
5
5
  "author": "mryhryki",
6
6
  "license": "MIT",
7
7
  "publishConfig": {
@@ -36,8 +36,8 @@
36
36
  "lint": "biome check ./src/**/*.ts ./**/*.html",
37
37
  "release": "npm run build && npm publish",
38
38
  "start": "npm run build && node ./index.js",
39
- "test": "jest",
40
- "test:watch": "jest --watchAll",
39
+ "test": "vitest",
40
+ "test:watch": "vitest watch",
41
41
  "type": "tsc --noEmit",
42
42
  "type:watch": "tsc --noEmit --watch"
43
43
  },
@@ -50,33 +50,27 @@
50
50
  "ws": "^8.18.0"
51
51
  },
52
52
  "devDependencies": {
53
- "@biomejs/biome": "1.9.4",
53
+ "@biomejs/biome": "2.0.0",
54
54
  "@types/express": "^5.0.0",
55
55
  "@types/express-ws": "^3.0.5",
56
- "@types/jest": "^29.5.14",
57
56
  "@types/opener": "^1.4.3",
58
57
  "@types/serve-index": "^1.9.4",
59
58
  "emojilib": "^4.0.1",
60
59
  "esbuild": "^0.25.0",
61
60
  "github-markdown-css": "^5.8.1",
62
61
  "highlight.js": "^11.11.1",
63
- "jest": "^29.7.0",
64
62
  "marked": "^15.0.6",
65
63
  "marked-emoji": "^2.0.0",
66
64
  "marked-highlight": "^2.2.1",
67
65
  "mermaid": "^11.4.1",
68
66
  "nodemon": "^3.1.9",
69
- "ts-jest": "^29.2.5",
70
- "typescript": "^5.7.3"
67
+ "typescript": "^5.7.3",
68
+ "vitest": "^3.2.3"
71
69
  },
72
70
  "files": [
73
71
  "index.js",
74
72
  "src/**/*.js",
75
73
  "static/**/*",
76
74
  "template/**/*"
77
- ],
78
- "jest": {
79
- "preset": "ts-jest",
80
- "testEnvironment": "node"
81
- }
75
+ ]
82
76
  }
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const node_path_1 = __importDefault(require("node:path"));
7
+ const vitest_1 = require("vitest");
7
8
  const directory_1 = require("./directory");
8
9
  const params_1 = require("./params");
9
10
  const DEFAULT_VALUES = {
@@ -16,12 +17,12 @@ const DEFAULT_VALUES = {
16
17
  version: false,
17
18
  help: false,
18
19
  };
19
- describe("Params", () => {
20
- it("not specify", () => {
20
+ (0, vitest_1.describe)("Params", () => {
21
+ (0, vitest_1.it)("not specify", () => {
21
22
  const params = new params_1.Params({}, []);
22
- expect(params._params).toEqual(DEFAULT_VALUES);
23
+ (0, vitest_1.expect)(params._params).toEqual(DEFAULT_VALUES);
23
24
  });
24
- it("specify all short argument", () => {
25
+ (0, vitest_1.it)("specify all short argument", () => {
25
26
  const argv = [
26
27
  "-f",
27
28
  "test/markdown/markdown1.md",
@@ -45,9 +46,9 @@ describe("Params", () => {
45
46
  help: true,
46
47
  };
47
48
  const params = new params_1.Params({}, argv);
48
- expect(params._params).toEqual(expectParams);
49
+ (0, vitest_1.expect)(params._params).toEqual(expectParams);
49
50
  });
50
- it("specify all long argument", () => {
51
+ (0, vitest_1.it)("specify all long argument", () => {
51
52
  const argv = [
52
53
  "--file",
53
54
  "test/markdown/markdown1.md",
@@ -74,9 +75,9 @@ describe("Params", () => {
74
75
  help: true,
75
76
  };
76
77
  const params = new params_1.Params({}, argv);
77
- expect(params._params).toEqual(expectParams);
78
+ (0, vitest_1.expect)(params._params).toEqual(expectParams);
78
79
  });
79
- it("specify all environment variable", () => {
80
+ (0, vitest_1.it)("specify all environment variable", () => {
80
81
  const env = {
81
82
  MARKDOWN_PREVIEW_FILE: "test/markdown/markdown1.md",
82
83
  MARKDOWN_PREVIEW_EXTENSIONS: "ext1, ext2",
@@ -96,6 +97,6 @@ describe("Params", () => {
96
97
  help: false,
97
98
  };
98
99
  const params = new params_1.Params(env, []);
99
- expect(params._params).toEqual(expectParams);
100
+ (0, vitest_1.expect)(params._params).toEqual(expectParams);
100
101
  });
101
102
  });
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const vitest_1 = require("vitest");
3
4
  const socket_manager_1 = require("./socket_manager");
4
5
  // biome-ignore lint/suspicious/noExplicitAny: It is used for testing only.
5
6
  const dummySocket1 = { name: "socket1" };
@@ -12,33 +13,33 @@ const dummyFilepath2 = "file2";
12
13
  const dummyInfo1 = { socket: dummySocket1, filepath: dummyFilepath1 };
13
14
  const dummyInfo2 = { socket: dummySocket2, filepath: dummyFilepath2 };
14
15
  const dummyInfo3 = { socket: dummySocket3, filepath: dummyFilepath2 };
15
- describe("SocketManager", () => {
16
- it("works normally", () => {
16
+ (0, vitest_1.describe)("SocketManager", () => {
17
+ (0, vitest_1.it)("works normally", () => {
17
18
  const socketManager = new socket_manager_1.SocketManager();
18
- expect(socketManager._sockets).toEqual([]);
19
+ (0, vitest_1.expect)(socketManager._sockets).toEqual([]);
19
20
  socketManager.addSocket(dummySocket1, dummyFilepath1);
20
- expect(socketManager._sockets).toEqual([dummyInfo1]);
21
+ (0, vitest_1.expect)(socketManager._sockets).toEqual([dummyInfo1]);
21
22
  socketManager.addSocket(dummySocket2, dummyFilepath2);
22
- expect(socketManager._sockets).toEqual([dummyInfo1, dummyInfo2]);
23
+ (0, vitest_1.expect)(socketManager._sockets).toEqual([dummyInfo1, dummyInfo2]);
23
24
  socketManager.addSocket(dummySocket3, dummyFilepath2);
24
- expect(socketManager._sockets).toEqual([
25
+ (0, vitest_1.expect)(socketManager._sockets).toEqual([
25
26
  dummyInfo1,
26
27
  dummyInfo2,
27
28
  dummyInfo3,
28
29
  ]);
29
- expect(socketManager.getSockets(dummyFilepath1)).toEqual([dummySocket1]);
30
- expect(socketManager.getSockets(dummyFilepath2)).toEqual([
30
+ (0, vitest_1.expect)(socketManager.getSockets(dummyFilepath1)).toEqual([dummySocket1]);
31
+ (0, vitest_1.expect)(socketManager.getSockets(dummyFilepath2)).toEqual([
31
32
  dummySocket2,
32
33
  dummySocket3,
33
34
  ]);
34
- expect(socketManager.countSocket()).toEqual(3);
35
- expect(socketManager.countSocket(dummyFilepath1)).toEqual(1);
36
- expect(socketManager.countSocket(dummyFilepath2)).toEqual(2);
35
+ (0, vitest_1.expect)(socketManager.countSocket()).toEqual(3);
36
+ (0, vitest_1.expect)(socketManager.countSocket(dummyFilepath1)).toEqual(1);
37
+ (0, vitest_1.expect)(socketManager.countSocket(dummyFilepath2)).toEqual(2);
37
38
  socketManager.removeSocket(dummySocket2);
38
- expect(socketManager._sockets).toEqual([dummyInfo1, dummyInfo3]);
39
+ (0, vitest_1.expect)(socketManager._sockets).toEqual([dummyInfo1, dummyInfo3]);
39
40
  socketManager.removeSocket(dummySocket1);
40
- expect(socketManager._sockets).toEqual([dummyInfo3]);
41
+ (0, vitest_1.expect)(socketManager._sockets).toEqual([dummyInfo3]);
41
42
  socketManager.removeSocket(dummySocket3);
42
- expect(socketManager._sockets).toEqual([]);
43
+ (0, vitest_1.expect)(socketManager._sockets).toEqual([]);
43
44
  });
44
45
  });
@@ -51837,17 +51837,17 @@ function edit(regex2, opt = "") {
51837
51837
  };
51838
51838
  return obj;
51839
51839
  }
51840
- function escape2(html3, encode) {
51840
+ function escape22(html22, encode) {
51841
51841
  if (encode) {
51842
- if (other.escapeTest.test(html3)) {
51843
- return html3.replace(other.escapeReplace, getEscapeReplacement);
51842
+ if (other.escapeTest.test(html22)) {
51843
+ return html22.replace(other.escapeReplace, getEscapeReplacement);
51844
51844
  }
51845
51845
  } else {
51846
- if (other.escapeTestNoEncode.test(html3)) {
51847
- return html3.replace(other.escapeReplaceNoEncode, getEscapeReplacement);
51846
+ if (other.escapeTestNoEncode.test(html22)) {
51847
+ return html22.replace(other.escapeReplaceNoEncode, getEscapeReplacement);
51848
51848
  }
51849
51849
  }
51850
- return html3;
51850
+ return html22;
51851
51851
  }
51852
51852
  function cleanUrl(href) {
51853
51853
  try {
@@ -51861,8 +51861,7 @@ function splitCells(tableRow, count) {
51861
51861
  const row = tableRow.replace(other.findPipe, (match2, offset, str2) => {
51862
51862
  let escaped = false;
51863
51863
  let curr = offset;
51864
- while (--curr >= 0 && str2[curr] === "\\")
51865
- escaped = !escaped;
51864
+ while (--curr >= 0 && str2[curr] === "\\") escaped = !escaped;
51866
51865
  if (escaped) {
51867
51866
  return "|";
51868
51867
  } else {
@@ -51880,8 +51879,7 @@ function splitCells(tableRow, count) {
51880
51879
  if (cells.length > count) {
51881
51880
  cells.splice(count);
51882
51881
  } else {
51883
- while (cells.length < count)
51884
- cells.push("");
51882
+ while (cells.length < count) cells.push("");
51885
51883
  }
51886
51884
  }
51887
51885
  for (; i3 < cells.length; i3++) {
@@ -51897,7 +51895,9 @@ function rtrim(str2, c3, invert2) {
51897
51895
  let suffLen = 0;
51898
51896
  while (suffLen < l2) {
51899
51897
  const currChar = str2.charAt(l2 - suffLen - 1);
51900
- if (currChar === c3 && true) {
51898
+ if (currChar === c3 && !invert2) {
51899
+ suffLen++;
51900
+ } else if (currChar !== c3 && invert2) {
51901
51901
  suffLen++;
51902
51902
  } else {
51903
51903
  break;
@@ -51927,9 +51927,9 @@ function findClosingBracket(str2, b2) {
51927
51927
  }
51928
51928
  return -1;
51929
51929
  }
51930
- function outputLink(cap, link3, raw, lexer2, rules) {
51931
- const href = link3.href;
51932
- const title2 = link3.title || null;
51930
+ function outputLink(cap, link22, raw, lexer2, rules) {
51931
+ const href = link22.href;
51932
+ const title2 = link22.title || null;
51933
51933
  const text4 = cap[1].replace(rules.other.outputLinkReplace, "$1");
51934
51934
  lexer2.state.inLink = true;
51935
51935
  const token2 = {
@@ -51964,7 +51964,7 @@ function indentCodeCompensation(raw, text4, rules) {
51964
51964
  function marked(src, opt) {
51965
51965
  return markedInstance.parse(src, opt);
51966
51966
  }
51967
- var _defaults, noopTest, other, newline, blockCode, fences, hr, heading, bullet, lheadingCore, lheading, lheadingGfm, _paragraph, blockText, _blockLabel, def, list, _tag, _comment, html, paragraph, blockquote, blockNormal, gfmTable, blockGfm, blockPedantic, escape$1, inlineCode, br, inlineText, _punctuation, _punctuationOrSpace, _notPunctuationOrSpace, punctuation, _punctuationGfmStrongEm, _punctuationOrSpaceGfmStrongEm, _notPunctuationOrSpaceGfmStrongEm, blockSkip, emStrongLDelimCore, emStrongLDelim, emStrongLDelimGfm, emStrongRDelimAstCore, emStrongRDelimAst, emStrongRDelimAstGfm, emStrongRDelimUnd, anyPunctuation, autolink, _inlineComment, tag, _inlineLabel, link, reflink, nolink, reflinkSearch, inlineNormal, inlinePedantic, inlineGfm, inlineBreaks, block, inline, escapeReplacements, getEscapeReplacement, _Tokenizer, _Lexer, _Renderer, _TextRenderer, _Parser, _Hooks, Marked, markedInstance, options, setOptions, use, walkTokens, parseInline, parser, lexer;
51967
+ var _defaults, noopTest, other, newline, blockCode, fences, hr, heading, bullet, lheadingCore, lheading, lheadingGfm, _paragraph, blockText, _blockLabel, def, list, _tag, _comment, html, paragraph, blockquote, blockNormal, gfmTable, blockGfm, blockPedantic, escape2, inlineCode, br, inlineText, _punctuation, _punctuationOrSpace, _notPunctuationOrSpace, punctuation, _punctuationGfmStrongEm, _punctuationOrSpaceGfmStrongEm, _notPunctuationOrSpaceGfmStrongEm, blockSkip, emStrongLDelimCore, emStrongLDelim, emStrongLDelimGfm, emStrongRDelimAstCore, emStrongRDelimAst, emStrongRDelimAstGfm, emStrongRDelimUnd, anyPunctuation, autolink, _inlineComment, tag, _inlineLabel, link, reflink, nolink, reflinkSearch, inlineNormal, inlinePedantic, inlineGfm, inlineBreaks, block, inline, escapeReplacements, getEscapeReplacement, _Tokenizer, _Lexer, _Renderer, _TextRenderer, _Parser, _Hooks, Marked, markedInstance, options, setOptions, use, walkTokens, parseInline, parser, lexer;
51968
51968
  var init_marked_esm = __esm({
51969
51969
  "node_modules/marked/lib/marked.esm.js"() {
51970
51970
  _defaults = _getDefaults();
@@ -52043,7 +52043,10 @@ var init_marked_esm = __esm({
52043
52043
  list = edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, bullet).getRegex();
52044
52044
  _tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
52045
52045
  _comment = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
52046
- html = edit("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", _comment).replace("tag", _tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
52046
+ html = edit(
52047
+ "^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))",
52048
+ "i"
52049
+ ).replace("comment", _comment).replace("tag", _tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
52047
52050
  paragraph = edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex();
52048
52051
  blockquote = edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", paragraph).getRegex();
52049
52052
  blockNormal = {
@@ -52061,7 +52064,9 @@ var init_marked_esm = __esm({
52061
52064
  table: noopTest,
52062
52065
  text: blockText
52063
52066
  };
52064
- gfmTable = edit("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex();
52067
+ gfmTable = edit(
52068
+ "^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
52069
+ ).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex();
52065
52070
  blockGfm = {
52066
52071
  ...blockNormal,
52067
52072
  lheading: lheadingGfm,
@@ -52070,7 +52075,9 @@ var init_marked_esm = __esm({
52070
52075
  };
52071
52076
  blockPedantic = {
52072
52077
  ...blockNormal,
52073
- html: edit(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", _comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
52078
+ html: edit(
52079
+ `^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
52080
+ ).replace("comment", _comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
52074
52081
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
52075
52082
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
52076
52083
  fences: noopTest,
@@ -52078,7 +52085,7 @@ var init_marked_esm = __esm({
52078
52085
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
52079
52086
  paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", lheading).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
52080
52087
  };
52081
- escape$1 = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
52088
+ escape2 = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
52082
52089
  inlineCode = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
52083
52090
  br = /^( {2,}|\\)\n(?!\s*$)/;
52084
52091
  inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
@@ -52096,11 +52103,16 @@ var init_marked_esm = __esm({
52096
52103
  emStrongRDelimAstCore = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
52097
52104
  emStrongRDelimAst = edit(emStrongRDelimAstCore, "gu").replace(/notPunctSpace/g, _notPunctuationOrSpace).replace(/punctSpace/g, _punctuationOrSpace).replace(/punct/g, _punctuation).getRegex();
52098
52105
  emStrongRDelimAstGfm = edit(emStrongRDelimAstCore, "gu").replace(/notPunctSpace/g, _notPunctuationOrSpaceGfmStrongEm).replace(/punctSpace/g, _punctuationOrSpaceGfmStrongEm).replace(/punct/g, _punctuationGfmStrongEm).getRegex();
52099
- emStrongRDelimUnd = edit("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, _notPunctuationOrSpace).replace(/punctSpace/g, _punctuationOrSpace).replace(/punct/g, _punctuation).getRegex();
52106
+ emStrongRDelimUnd = edit(
52107
+ "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)",
52108
+ "gu"
52109
+ ).replace(/notPunctSpace/g, _notPunctuationOrSpace).replace(/punctSpace/g, _punctuationOrSpace).replace(/punct/g, _punctuation).getRegex();
52100
52110
  anyPunctuation = edit(/\\(punct)/, "gu").replace(/punct/g, _punctuation).getRegex();
52101
52111
  autolink = edit(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
52102
52112
  _inlineComment = edit(_comment).replace("(?:-->|$)", "-->").getRegex();
52103
- tag = edit("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", _inlineComment).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
52113
+ tag = edit(
52114
+ "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>"
52115
+ ).replace("comment", _inlineComment).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
52104
52116
  _inlineLabel = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
52105
52117
  link = edit(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", _inlineLabel).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
52106
52118
  reflink = edit(/^!?\[(label)\]\[(ref)\]/).replace("label", _inlineLabel).replace("ref", _blockLabel).getRegex();
@@ -52118,7 +52130,7 @@ var init_marked_esm = __esm({
52118
52130
  emStrongLDelim,
52119
52131
  emStrongRDelimAst,
52120
52132
  emStrongRDelimUnd,
52121
- escape: escape$1,
52133
+ escape: escape2,
52122
52134
  link,
52123
52135
  nolink,
52124
52136
  punctuation,
@@ -52172,8 +52184,8 @@ var init_marked_esm = __esm({
52172
52184
  // set by the lexer
52173
52185
  lexer;
52174
52186
  // set by the lexer
52175
- constructor(options3) {
52176
- this.options = options3 || _defaults;
52187
+ constructor(options22) {
52188
+ this.options = options22 || _defaults;
52177
52189
  }
52178
52190
  space(src) {
52179
52191
  const cap = this.rules.block.newline.exec(src);
@@ -52642,10 +52654,10 @@ ${currentText}` : currentText;
52642
52654
  let href = cap[2];
52643
52655
  let title2 = "";
52644
52656
  if (this.options.pedantic) {
52645
- const link3 = this.rules.other.pedanticHrefTitle.exec(href);
52646
- if (link3) {
52647
- href = link3[1];
52648
- title2 = link3[3];
52657
+ const link22 = this.rules.other.pedanticHrefTitle.exec(href);
52658
+ if (link22) {
52659
+ href = link22[1];
52660
+ title2 = link22[3];
52649
52661
  }
52650
52662
  } else {
52651
52663
  title2 = cap[3] ? cap[3].slice(1, -1) : "";
@@ -52668,8 +52680,8 @@ ${currentText}` : currentText;
52668
52680
  let cap;
52669
52681
  if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
52670
52682
  const linkString = (cap[2] || cap[1]).replace(this.rules.other.multipleSpaceGlobal, " ");
52671
- const link3 = links3[linkString.toLowerCase()];
52672
- if (!link3) {
52683
+ const link22 = links3[linkString.toLowerCase()];
52684
+ if (!link22) {
52673
52685
  const text4 = cap[0].charAt(0);
52674
52686
  return {
52675
52687
  type: "text",
@@ -52677,15 +52689,13 @@ ${currentText}` : currentText;
52677
52689
  text: text4
52678
52690
  };
52679
52691
  }
52680
- return outputLink(cap, link3, cap[0], this.lexer, this.rules);
52692
+ return outputLink(cap, link22, cap[0], this.lexer, this.rules);
52681
52693
  }
52682
52694
  }
52683
52695
  emStrong(src, maskedSrc, prevChar = "") {
52684
52696
  let match2 = this.rules.inline.emStrongLDelim.exec(src);
52685
- if (!match2)
52686
- return;
52687
- if (match2[3] && prevChar.match(this.rules.other.unicodeAlphaNumeric))
52688
- return;
52697
+ if (!match2) return;
52698
+ if (match2[3] && prevChar.match(this.rules.other.unicodeAlphaNumeric)) return;
52689
52699
  const nextChar = match2[1] || match2[2] || "";
52690
52700
  if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {
52691
52701
  const lLength = [...match2[0]].length - 1;
@@ -52695,8 +52705,7 @@ ${currentText}` : currentText;
52695
52705
  maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
52696
52706
  while ((match2 = endReg.exec(maskedSrc)) != null) {
52697
52707
  rDelim = match2[1] || match2[2] || match2[3] || match2[4] || match2[5] || match2[6];
52698
- if (!rDelim)
52699
- continue;
52708
+ if (!rDelim) continue;
52700
52709
  rLength = [...rDelim].length;
52701
52710
  if (match2[3] || match2[4]) {
52702
52711
  delimTotal += rLength;
@@ -52708,18 +52717,17 @@ ${currentText}` : currentText;
52708
52717
  }
52709
52718
  }
52710
52719
  delimTotal -= rLength;
52711
- if (delimTotal > 0)
52712
- continue;
52720
+ if (delimTotal > 0) continue;
52713
52721
  rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
52714
52722
  const lastCharLength = [...match2[0]][0].length;
52715
52723
  const raw = src.slice(0, lLength + match2.index + lastCharLength + rLength);
52716
52724
  if (Math.min(lLength, rLength) % 2) {
52717
- const text5 = raw.slice(1, -1);
52725
+ const text22 = raw.slice(1, -1);
52718
52726
  return {
52719
52727
  type: "em",
52720
52728
  raw,
52721
- text: text5,
52722
- tokens: this.lexer.inlineTokens(text5)
52729
+ text: text22,
52730
+ tokens: this.lexer.inlineTokens(text22)
52723
52731
  };
52724
52732
  }
52725
52733
  const text4 = raw.slice(2, -2);
@@ -52848,10 +52856,10 @@ ${currentText}` : currentText;
52848
52856
  state;
52849
52857
  tokenizer;
52850
52858
  inlineQueue;
52851
- constructor(options3) {
52859
+ constructor(options22) {
52852
52860
  this.tokens = [];
52853
52861
  this.tokens.links = /* @__PURE__ */ Object.create(null);
52854
- this.options = options3 || _defaults;
52862
+ this.options = options22 || _defaults;
52855
52863
  this.options.tokenizer = this.options.tokenizer || new _Tokenizer();
52856
52864
  this.tokenizer = this.options.tokenizer;
52857
52865
  this.tokenizer.options = this.options;
@@ -52892,15 +52900,15 @@ ${currentText}` : currentText;
52892
52900
  /**
52893
52901
  * Static Lex Method
52894
52902
  */
52895
- static lex(src, options3) {
52896
- const lexer2 = new __Lexer(options3);
52903
+ static lex(src, options22) {
52904
+ const lexer2 = new __Lexer(options22);
52897
52905
  return lexer2.lex(src);
52898
52906
  }
52899
52907
  /**
52900
52908
  * Static Lex Inline Method
52901
52909
  */
52902
- static lexInline(src, options3) {
52903
- const lexer2 = new __Lexer(options3);
52910
+ static lexInline(src, options22) {
52911
+ const lexer2 = new __Lexer(options22);
52904
52912
  return lexer2.inlineTokens(src);
52905
52913
  }
52906
52914
  /**
@@ -53211,8 +53219,8 @@ ${currentText}` : currentText;
53211
53219
  options;
53212
53220
  parser;
53213
53221
  // set by the parser
53214
- constructor(options3) {
53215
- this.options = options3 || _defaults;
53222
+ constructor(options22) {
53223
+ this.options = options22 || _defaults;
53216
53224
  }
53217
53225
  space(token2) {
53218
53226
  return "";
@@ -53221,9 +53229,9 @@ ${currentText}` : currentText;
53221
53229
  const langString = (lang || "").match(other.notSpaceStart)?.[0];
53222
53230
  const code = text4.replace(other.endingNewline, "") + "\n";
53223
53231
  if (!langString) {
53224
- return "<pre><code>" + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
53232
+ return "<pre><code>" + (escaped ? code : escape22(code, true)) + "</code></pre>\n";
53225
53233
  }
53226
- return '<pre><code class="language-' + escape2(langString) + '">' + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
53234
+ return '<pre><code class="language-' + escape22(langString) + '">' + (escaped ? code : escape22(code, true)) + "</code></pre>\n";
53227
53235
  }
53228
53236
  blockquote({ tokens: tokens2 }) {
53229
53237
  const body = this.parser.parse(tokens2);
@@ -53261,7 +53269,7 @@ ${body}</blockquote>
53261
53269
  if (item.tokens[0]?.type === "paragraph") {
53262
53270
  item.tokens[0].text = checkbox + " " + item.tokens[0].text;
53263
53271
  if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") {
53264
- item.tokens[0].tokens[0].text = checkbox + " " + escape2(item.tokens[0].tokens[0].text);
53272
+ item.tokens[0].tokens[0].text = checkbox + " " + escape22(item.tokens[0].tokens[0].text);
53265
53273
  item.tokens[0].tokens[0].escaped = true;
53266
53274
  }
53267
53275
  } else {
@@ -53303,8 +53311,7 @@ ${body}</blockquote>
53303
53311
  }
53304
53312
  body += this.tablerow({ text: cell });
53305
53313
  }
53306
- if (body)
53307
- body = `<tbody>${body}</tbody>`;
53314
+ if (body) body = `<tbody>${body}</tbody>`;
53308
53315
  return "<table>\n<thead>\n" + header + "</thead>\n" + body + "</table>\n";
53309
53316
  }
53310
53317
  tablerow({ text: text4 }) {
@@ -53329,7 +53336,7 @@ ${text4}</tr>
53329
53336
  return `<em>${this.parser.parseInline(tokens2)}</em>`;
53330
53337
  }
53331
53338
  codespan({ text: text4 }) {
53332
- return `<code>${escape2(text4, true)}</code>`;
53339
+ return `<code>${escape22(text4, true)}</code>`;
53333
53340
  }
53334
53341
  br(token2) {
53335
53342
  return "<br>";
@@ -53346,7 +53353,7 @@ ${text4}</tr>
53346
53353
  href = cleanHref;
53347
53354
  let out = '<a href="' + href + '"';
53348
53355
  if (title2) {
53349
- out += ' title="' + escape2(title2) + '"';
53356
+ out += ' title="' + escape22(title2) + '"';
53350
53357
  }
53351
53358
  out += ">" + text4 + "</a>";
53352
53359
  return out;
@@ -53357,18 +53364,18 @@ ${text4}</tr>
53357
53364
  }
53358
53365
  const cleanHref = cleanUrl(href);
53359
53366
  if (cleanHref === null) {
53360
- return escape2(text4);
53367
+ return escape22(text4);
53361
53368
  }
53362
53369
  href = cleanHref;
53363
53370
  let out = `<img src="${href}" alt="${text4}"`;
53364
53371
  if (title2) {
53365
- out += ` title="${escape2(title2)}"`;
53372
+ out += ` title="${escape22(title2)}"`;
53366
53373
  }
53367
53374
  out += ">";
53368
53375
  return out;
53369
53376
  }
53370
53377
  text(token2) {
53371
- return "tokens" in token2 && token2.tokens ? this.parser.parseInline(token2.tokens) : "escaped" in token2 && token2.escaped ? token2.text : escape2(token2.text);
53378
+ return "tokens" in token2 && token2.tokens ? this.parser.parseInline(token2.tokens) : "escaped" in token2 && token2.escaped ? token2.text : escape22(token2.text);
53372
53379
  }
53373
53380
  };
53374
53381
  _TextRenderer = class {
@@ -53405,8 +53412,8 @@ ${text4}</tr>
53405
53412
  options;
53406
53413
  renderer;
53407
53414
  textRenderer;
53408
- constructor(options3) {
53409
- this.options = options3 || _defaults;
53415
+ constructor(options22) {
53416
+ this.options = options22 || _defaults;
53410
53417
  this.options.renderer = this.options.renderer || new _Renderer();
53411
53418
  this.renderer = this.options.renderer;
53412
53419
  this.renderer.options = this.options;
@@ -53416,15 +53423,15 @@ ${text4}</tr>
53416
53423
  /**
53417
53424
  * Static Parse Method
53418
53425
  */
53419
- static parse(tokens2, options3) {
53420
- const parser24 = new __Parser(options3);
53426
+ static parse(tokens2, options22) {
53427
+ const parser24 = new __Parser(options22);
53421
53428
  return parser24.parse(tokens2);
53422
53429
  }
53423
53430
  /**
53424
53431
  * Static Parse Inline Method
53425
53432
  */
53426
- static parseInline(tokens2, options3) {
53427
- const parser24 = new __Parser(options3);
53433
+ static parseInline(tokens2, options22) {
53434
+ const parser24 = new __Parser(options22);
53428
53435
  return parser24.parseInline(tokens2);
53429
53436
  }
53430
53437
  /**
@@ -53585,8 +53592,8 @@ ${text4}</tr>
53585
53592
  _Hooks = class {
53586
53593
  options;
53587
53594
  block;
53588
- constructor(options3) {
53589
- this.options = options3 || _defaults;
53595
+ constructor(options22) {
53596
+ this.options = options22 || _defaults;
53590
53597
  }
53591
53598
  static passThroughHooks = /* @__PURE__ */ new Set([
53592
53599
  "preprocess",
@@ -53602,8 +53609,8 @@ ${text4}</tr>
53602
53609
  /**
53603
53610
  * Process HTML after marked is finished
53604
53611
  */
53605
- postprocess(html3) {
53606
- return html3;
53612
+ postprocess(html22) {
53613
+ return html22;
53607
53614
  }
53608
53615
  /**
53609
53616
  * Process all tokens before walk tokens
@@ -53667,8 +53674,8 @@ ${text4}</tr>
53667
53674
  const genericToken = token2;
53668
53675
  if (this.defaults.extensions?.childTokens?.[genericToken.type]) {
53669
53676
  this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {
53670
- const tokens3 = genericToken[childTokens].flat(Infinity);
53671
- values2 = values2.concat(this.walkTokens(tokens3, callback));
53677
+ const tokens22 = genericToken[childTokens].flat(Infinity);
53678
+ values2 = values2.concat(this.walkTokens(tokens22, callback));
53672
53679
  });
53673
53680
  } else if (genericToken.tokens) {
53674
53681
  values2 = values2.concat(this.walkTokens(genericToken.tokens, callback));
@@ -53832,15 +53839,15 @@ ${text4}</tr>
53832
53839
  this.defaults = { ...this.defaults, ...opt };
53833
53840
  return this;
53834
53841
  }
53835
- lexer(src, options3) {
53836
- return _Lexer.lex(src, options3 ?? this.defaults);
53842
+ lexer(src, options22) {
53843
+ return _Lexer.lex(src, options22 ?? this.defaults);
53837
53844
  }
53838
- parser(tokens2, options3) {
53839
- return _Parser.parse(tokens2, options3 ?? this.defaults);
53845
+ parser(tokens2, options22) {
53846
+ return _Parser.parse(tokens2, options22 ?? this.defaults);
53840
53847
  }
53841
53848
  parseMarkdown(blockType) {
53842
- const parse6 = (src, options3) => {
53843
- const origOpt = { ...options3 };
53849
+ const parse23 = (src, options22) => {
53850
+ const origOpt = { ...options22 };
53844
53851
  const opt = { ...this.defaults, ...origOpt };
53845
53852
  const throwError2 = this.onError(!!opt.silent, !!opt.async);
53846
53853
  if (this.defaults.async === true && origOpt.async === false) {
@@ -53859,7 +53866,7 @@ ${text4}</tr>
53859
53866
  const lexer2 = opt.hooks ? opt.hooks.provideLexer() : blockType ? _Lexer.lex : _Lexer.lexInline;
53860
53867
  const parser24 = opt.hooks ? opt.hooks.provideParser() : blockType ? _Parser.parse : _Parser.parseInline;
53861
53868
  if (opt.async) {
53862
- return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens2) => opt.hooks ? opt.hooks.processAllTokens(tokens2) : tokens2).then((tokens2) => opt.walkTokens ? Promise.all(this.walkTokens(tokens2, opt.walkTokens)).then(() => tokens2) : tokens2).then((tokens2) => parser24(tokens2, opt)).then((html3) => opt.hooks ? opt.hooks.postprocess(html3) : html3).catch(throwError2);
53869
+ return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens2) => opt.hooks ? opt.hooks.processAllTokens(tokens2) : tokens2).then((tokens2) => opt.walkTokens ? Promise.all(this.walkTokens(tokens2, opt.walkTokens)).then(() => tokens2) : tokens2).then((tokens2) => parser24(tokens2, opt)).then((html22) => opt.hooks ? opt.hooks.postprocess(html22) : html22).catch(throwError2);
53863
53870
  }
53864
53871
  try {
53865
53872
  if (opt.hooks) {
@@ -53872,22 +53879,22 @@ ${text4}</tr>
53872
53879
  if (opt.walkTokens) {
53873
53880
  this.walkTokens(tokens2, opt.walkTokens);
53874
53881
  }
53875
- let html3 = parser24(tokens2, opt);
53882
+ let html22 = parser24(tokens2, opt);
53876
53883
  if (opt.hooks) {
53877
- html3 = opt.hooks.postprocess(html3);
53884
+ html22 = opt.hooks.postprocess(html22);
53878
53885
  }
53879
- return html3;
53886
+ return html22;
53880
53887
  } catch (e3) {
53881
53888
  return throwError2(e3);
53882
53889
  }
53883
53890
  };
53884
- return parse6;
53891
+ return parse23;
53885
53892
  }
53886
53893
  onError(silent, async) {
53887
53894
  return (e3) => {
53888
53895
  e3.message += "\nPlease report this to https://github.com/markedjs/marked.";
53889
53896
  if (silent) {
53890
- const msg = "<p>An error occurred:</p><pre>" + escape2(e3.message + "", true) + "</pre>";
53897
+ const msg = "<p>An error occurred:</p><pre>" + escape22(e3.message + "", true) + "</pre>";
53891
53898
  if (async) {
53892
53899
  return Promise.resolve(msg);
53893
53900
  }
@@ -53901,8 +53908,8 @@ ${text4}</tr>
53901
53908
  }
53902
53909
  };
53903
53910
  markedInstance = new Marked();
53904
- marked.options = marked.setOptions = function(options3) {
53905
- markedInstance.setOptions(options3);
53911
+ marked.options = marked.setOptions = function(options22) {
53912
+ markedInstance.setOptions(options22);
53906
53913
  marked.defaults = markedInstance.defaults;
53907
53914
  changeDefaults(marked.defaults);
53908
53915
  return marked;