bunki 0.7.1 → 0.9.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/README.md +199 -3
- package/dist/cli.js +525 -334
- package/dist/index.js +527 -336
- package/dist/utils/json-ld.d.ts +205 -0
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -6547,24 +6547,24 @@ var require_lib = __commonJS((exports) => {
|
|
|
6547
6547
|
// node_modules/domhandler/lib/node.js
|
|
6548
6548
|
var require_node = __commonJS((exports) => {
|
|
6549
6549
|
var __extends = exports && exports.__extends || function() {
|
|
6550
|
-
var extendStatics = function(
|
|
6551
|
-
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(
|
|
6552
|
-
|
|
6553
|
-
} || function(
|
|
6550
|
+
var extendStatics = function(d2, b2) {
|
|
6551
|
+
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
|
|
6552
|
+
d3.__proto__ = b3;
|
|
6553
|
+
} || function(d3, b3) {
|
|
6554
6554
|
for (var p in b3)
|
|
6555
6555
|
if (Object.prototype.hasOwnProperty.call(b3, p))
|
|
6556
|
-
|
|
6556
|
+
d3[p] = b3[p];
|
|
6557
6557
|
};
|
|
6558
|
-
return extendStatics(
|
|
6558
|
+
return extendStatics(d2, b2);
|
|
6559
6559
|
};
|
|
6560
|
-
return function(
|
|
6560
|
+
return function(d2, b2) {
|
|
6561
6561
|
if (typeof b2 !== "function" && b2 !== null)
|
|
6562
6562
|
throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
|
|
6563
|
-
extendStatics(
|
|
6563
|
+
extendStatics(d2, b2);
|
|
6564
6564
|
function __() {
|
|
6565
|
-
this.constructor =
|
|
6565
|
+
this.constructor = d2;
|
|
6566
6566
|
}
|
|
6567
|
-
|
|
6567
|
+
d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __);
|
|
6568
6568
|
};
|
|
6569
6569
|
}();
|
|
6570
6570
|
var __assign = exports && exports.__assign || function() {
|
|
@@ -8669,7 +8669,7 @@ var require_parse_srcset = __commonJS((exports, module) => {
|
|
|
8669
8669
|
}
|
|
8670
8670
|
}
|
|
8671
8671
|
function parseDescriptors() {
|
|
8672
|
-
var pError = false, w2,
|
|
8672
|
+
var pError = false, w2, d2, h, i, candidate = {}, desc, lastChar, value, intVal, floatVal;
|
|
8673
8673
|
for (i = 0;i < descriptors.length; i++) {
|
|
8674
8674
|
desc = descriptors[i];
|
|
8675
8675
|
lastChar = desc[desc.length - 1];
|
|
@@ -8677,7 +8677,7 @@ var require_parse_srcset = __commonJS((exports, module) => {
|
|
|
8677
8677
|
intVal = parseInt(value, 10);
|
|
8678
8678
|
floatVal = parseFloat(value);
|
|
8679
8679
|
if (regexNonNegativeInteger.test(value) && lastChar === "w") {
|
|
8680
|
-
if (w2 ||
|
|
8680
|
+
if (w2 || d2) {
|
|
8681
8681
|
pError = true;
|
|
8682
8682
|
}
|
|
8683
8683
|
if (intVal === 0) {
|
|
@@ -8686,22 +8686,22 @@ var require_parse_srcset = __commonJS((exports, module) => {
|
|
|
8686
8686
|
w2 = intVal;
|
|
8687
8687
|
}
|
|
8688
8688
|
} else if (regexFloatingPoint.test(value) && lastChar === "x") {
|
|
8689
|
-
if (w2 ||
|
|
8689
|
+
if (w2 || d2 || h) {
|
|
8690
8690
|
pError = true;
|
|
8691
8691
|
}
|
|
8692
8692
|
if (floatVal < 0) {
|
|
8693
8693
|
pError = true;
|
|
8694
8694
|
} else {
|
|
8695
|
-
|
|
8695
|
+
d2 = floatVal;
|
|
8696
8696
|
}
|
|
8697
8697
|
} else if (regexNonNegativeInteger.test(value) && lastChar === "h") {
|
|
8698
|
-
if (
|
|
8698
|
+
if (h || d2) {
|
|
8699
8699
|
pError = true;
|
|
8700
8700
|
}
|
|
8701
8701
|
if (intVal === 0) {
|
|
8702
8702
|
pError = true;
|
|
8703
8703
|
} else {
|
|
8704
|
-
|
|
8704
|
+
h = intVal;
|
|
8705
8705
|
}
|
|
8706
8706
|
} else {
|
|
8707
8707
|
pError = true;
|
|
@@ -8712,11 +8712,11 @@ var require_parse_srcset = __commonJS((exports, module) => {
|
|
|
8712
8712
|
if (w2) {
|
|
8713
8713
|
candidate.w = w2;
|
|
8714
8714
|
}
|
|
8715
|
-
if (
|
|
8716
|
-
candidate.d =
|
|
8715
|
+
if (d2) {
|
|
8716
|
+
candidate.d = d2;
|
|
8717
8717
|
}
|
|
8718
|
-
if (
|
|
8719
|
-
candidate.h =
|
|
8718
|
+
if (h) {
|
|
8719
|
+
candidate.h = h;
|
|
8720
8720
|
}
|
|
8721
8721
|
candidates.push(candidate);
|
|
8722
8722
|
} else if (console && console.log) {
|
|
@@ -24831,10 +24831,10 @@ var require_tests = __commonJS((exports) => {
|
|
|
24831
24831
|
return value.toLowerCase() === value;
|
|
24832
24832
|
}
|
|
24833
24833
|
exports.lower = lower;
|
|
24834
|
-
function
|
|
24834
|
+
function ne2(one, two) {
|
|
24835
24835
|
return one !== two;
|
|
24836
24836
|
}
|
|
24837
|
-
exports.ne =
|
|
24837
|
+
exports.ne = ne2;
|
|
24838
24838
|
function nullTest(value) {
|
|
24839
24839
|
return value === null;
|
|
24840
24840
|
}
|
|
@@ -29034,88 +29034,95 @@ function L() {
|
|
|
29034
29034
|
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
29035
29035
|
}
|
|
29036
29036
|
var T = L();
|
|
29037
|
-
function
|
|
29037
|
+
function Z(u) {
|
|
29038
29038
|
T = u;
|
|
29039
29039
|
}
|
|
29040
|
-
var
|
|
29041
|
-
function
|
|
29040
|
+
var C = { exec: () => null };
|
|
29041
|
+
function k(u, e = "") {
|
|
29042
29042
|
let t = typeof u == "string" ? u : u.source, n = { replace: (r, i) => {
|
|
29043
29043
|
let s = typeof i == "string" ? i : i.source;
|
|
29044
29044
|
return s = s.replace(m.caret, "$1"), t = t.replace(r, s), n;
|
|
29045
29045
|
}, getRegex: () => new RegExp(t, e) };
|
|
29046
29046
|
return n;
|
|
29047
29047
|
}
|
|
29048
|
-
var
|
|
29049
|
-
|
|
29050
|
-
|
|
29051
|
-
|
|
29052
|
-
|
|
29053
|
-
|
|
29054
|
-
|
|
29055
|
-
var
|
|
29056
|
-
var
|
|
29057
|
-
var
|
|
29058
|
-
var
|
|
29059
|
-
var
|
|
29060
|
-
var
|
|
29061
|
-
var
|
|
29062
|
-
var
|
|
29048
|
+
var me = (() => {
|
|
29049
|
+
try {
|
|
29050
|
+
return !!new RegExp("(?<=1)(?<!1)");
|
|
29051
|
+
} catch {
|
|
29052
|
+
return false;
|
|
29053
|
+
}
|
|
29054
|
+
})();
|
|
29055
|
+
var m = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (u) => new RegExp(`^( {0,3}${u})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}#`), htmlBeginRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}<(?:[a-z].*>|!--)`, "i") };
|
|
29056
|
+
var xe = /^(?:[ \t]*(?:\n|$))+/;
|
|
29057
|
+
var be = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
|
|
29058
|
+
var Re = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
|
|
29059
|
+
var I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
|
|
29060
|
+
var Te = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
|
|
29061
|
+
var N = /(?:[*+-]|\d{1,9}[.)])/;
|
|
29062
|
+
var re = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
|
|
29063
|
+
var se = k(re).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
|
|
29064
|
+
var Oe = k(re).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
|
|
29065
|
+
var Q = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
|
|
29066
|
+
var we = /^[^\n]+/;
|
|
29067
|
+
var F = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
|
|
29068
|
+
var ye = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", F).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
|
|
29069
|
+
var Pe = k(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, N).getRegex();
|
|
29063
29070
|
var v = "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";
|
|
29064
|
-
var
|
|
29065
|
-
var
|
|
29066
|
-
var
|
|
29067
|
-
var
|
|
29068
|
-
var
|
|
29069
|
-
var
|
|
29070
|
-
var
|
|
29071
|
-
var
|
|
29072
|
-
]`).replace("lheading",
|
|
29073
|
-
var
|
|
29074
|
-
var
|
|
29075
|
-
var
|
|
29076
|
-
var
|
|
29071
|
+
var j = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
|
|
29072
|
+
var Se = k("^ {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[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))", "i").replace("comment", j).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
|
|
29073
|
+
var ie = k(Q).replace("hr", I).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", v).getRegex();
|
|
29074
|
+
var $e = k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ie).getRegex();
|
|
29075
|
+
var U = { blockquote: $e, code: be, def: ye, fences: Re, heading: Te, hr: I, html: Se, lheading: se, list: Pe, newline: xe, paragraph: ie, table: C, text: we };
|
|
29076
|
+
var te = k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3}\t)[^\\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", v).getRegex();
|
|
29077
|
+
var _e = { ...U, lheading: Oe, table: te, paragraph: k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", te).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", v).getRegex() };
|
|
29078
|
+
var Le = { ...U, html: k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", j).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(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: C, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: k(Q).replace("hr", I).replace("heading", ` *#{1,6} *[^
|
|
29079
|
+
]`).replace("lheading", se).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
|
|
29080
|
+
var Me = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
|
|
29081
|
+
var ze = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
|
|
29082
|
+
var oe = /^( {2,}|\\)\n(?!\s*$)/;
|
|
29083
|
+
var Ae = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
|
|
29077
29084
|
var D = /[\p{P}\p{S}]/u;
|
|
29078
|
-
var
|
|
29079
|
-
var
|
|
29080
|
-
var
|
|
29081
|
-
var
|
|
29082
|
-
var
|
|
29083
|
-
var
|
|
29084
|
-
var
|
|
29085
|
-
var
|
|
29086
|
-
var
|
|
29087
|
-
var
|
|
29088
|
-
var
|
|
29089
|
-
var
|
|
29090
|
-
var
|
|
29091
|
-
var
|
|
29092
|
-
var
|
|
29093
|
-
var
|
|
29094
|
-
var
|
|
29095
|
-
var
|
|
29085
|
+
var K = /[\s\p{P}\p{S}]/u;
|
|
29086
|
+
var ae = /[^\s\p{P}\p{S}]/u;
|
|
29087
|
+
var Ce = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, K).getRegex();
|
|
29088
|
+
var le = /(?!~)[\p{P}\p{S}]/u;
|
|
29089
|
+
var Ie = /(?!~)[\s\p{P}\p{S}]/u;
|
|
29090
|
+
var Ee = /(?:[^\s\p{P}\p{S}]|~)/u;
|
|
29091
|
+
var Be = k(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", me ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
|
|
29092
|
+
var ue = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
|
|
29093
|
+
var qe = k(ue, "u").replace(/punct/g, D).getRegex();
|
|
29094
|
+
var ve = k(ue, "u").replace(/punct/g, le).getRegex();
|
|
29095
|
+
var pe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
|
|
29096
|
+
var De = k(pe, "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, D).getRegex();
|
|
29097
|
+
var He = k(pe, "gu").replace(/notPunctSpace/g, Ee).replace(/punctSpace/g, Ie).replace(/punct/g, le).getRegex();
|
|
29098
|
+
var Ze = k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, D).getRegex();
|
|
29099
|
+
var Ge = k(/\\(punct)/, "gu").replace(/punct/g, D).getRegex();
|
|
29100
|
+
var Ne = k(/^<(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();
|
|
29101
|
+
var Qe = k(j).replace("(?:-->|$)", "-->").getRegex();
|
|
29102
|
+
var Fe = k("^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", Qe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
|
|
29096
29103
|
var q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/;
|
|
29097
|
-
var
|
|
29098
|
-
var
|
|
29099
|
-
var
|
|
29100
|
-
var
|
|
29101
|
-
var
|
|
29102
|
-
var
|
|
29103
|
-
var
|
|
29104
|
-
var
|
|
29105
|
-
var
|
|
29106
|
-
var
|
|
29107
|
-
var M = { normal:
|
|
29108
|
-
var
|
|
29109
|
-
var
|
|
29104
|
+
var je = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
|
|
29105
|
+
var ce = k(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", F).getRegex();
|
|
29106
|
+
var he = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", F).getRegex();
|
|
29107
|
+
var Ue = k("reflink|nolink(?!\\()", "g").replace("reflink", ce).replace("nolink", he).getRegex();
|
|
29108
|
+
var ne = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
|
|
29109
|
+
var W = { _backpedal: C, anyPunctuation: Ge, autolink: Ne, blockSkip: Be, br: oe, code: ze, del: C, emStrongLDelim: qe, emStrongRDelimAst: De, emStrongRDelimUnd: Ze, escape: Me, link: je, nolink: he, punctuation: Ce, reflink: ce, reflinkSearch: Ue, tag: Fe, text: Ae, url: C };
|
|
29110
|
+
var Ke = { ...W, link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() };
|
|
29111
|
+
var G = { ...W, emStrongRDelimAst: He, emStrongLDelim: ve, url: k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ne).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ne).getRegex() };
|
|
29112
|
+
var We = { ...G, br: k(oe).replace("{2,}", "*").getRegex(), text: k(G.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
|
|
29113
|
+
var E = { normal: U, gfm: _e, pedantic: Le };
|
|
29114
|
+
var M = { normal: W, gfm: G, breaks: We, pedantic: Ke };
|
|
29115
|
+
var Xe = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
|
|
29116
|
+
var ke = (u) => Xe[u];
|
|
29110
29117
|
function w(u, e) {
|
|
29111
29118
|
if (e) {
|
|
29112
29119
|
if (m.escapeTest.test(u))
|
|
29113
|
-
return u.replace(m.escapeReplace,
|
|
29120
|
+
return u.replace(m.escapeReplace, ke);
|
|
29114
29121
|
} else if (m.escapeTestNoEncode.test(u))
|
|
29115
|
-
return u.replace(m.escapeReplaceNoEncode,
|
|
29122
|
+
return u.replace(m.escapeReplaceNoEncode, ke);
|
|
29116
29123
|
return u;
|
|
29117
29124
|
}
|
|
29118
|
-
function
|
|
29125
|
+
function X(u) {
|
|
29119
29126
|
try {
|
|
29120
29127
|
u = encodeURI(u).replace(m.percentDecode, "%");
|
|
29121
29128
|
} catch {
|
|
@@ -29123,12 +29130,12 @@ function J(u) {
|
|
|
29123
29130
|
}
|
|
29124
29131
|
return u;
|
|
29125
29132
|
}
|
|
29126
|
-
function
|
|
29127
|
-
let t = u.replace(m.findPipe, (i, s,
|
|
29128
|
-
let
|
|
29129
|
-
for (;--l >= 0 &&
|
|
29130
|
-
|
|
29131
|
-
return
|
|
29133
|
+
function J(u, e) {
|
|
29134
|
+
let t = u.replace(m.findPipe, (i, s, a) => {
|
|
29135
|
+
let o = false, l = s;
|
|
29136
|
+
for (;--l >= 0 && a[l] === "\\"; )
|
|
29137
|
+
o = !o;
|
|
29138
|
+
return o ? "|" : " |";
|
|
29132
29139
|
}), n = t.split(m.splitPipe), r = 0;
|
|
29133
29140
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e)
|
|
29134
29141
|
if (n.length > e)
|
|
@@ -29156,7 +29163,7 @@ function z(u, e, t) {
|
|
|
29156
29163
|
}
|
|
29157
29164
|
return u.slice(0, n - r);
|
|
29158
29165
|
}
|
|
29159
|
-
function
|
|
29166
|
+
function de(u, e) {
|
|
29160
29167
|
if (u.indexOf(e[1]) === -1)
|
|
29161
29168
|
return -1;
|
|
29162
29169
|
let t = 0;
|
|
@@ -29169,13 +29176,13 @@ function fe(u, e) {
|
|
|
29169
29176
|
return n;
|
|
29170
29177
|
return t > 0 ? -2 : -1;
|
|
29171
29178
|
}
|
|
29172
|
-
function
|
|
29173
|
-
let i = e.href, s = e.title || null,
|
|
29179
|
+
function ge(u, e, t, n, r) {
|
|
29180
|
+
let i = e.href, s = e.title || null, a = u[1].replace(r.other.outputLinkReplace, "$1");
|
|
29174
29181
|
n.state.inLink = true;
|
|
29175
|
-
let
|
|
29176
|
-
return n.state.inLink = false,
|
|
29182
|
+
let o = { type: u[0].charAt(0) === "!" ? "image" : "link", raw: t, href: i, title: s, text: a, tokens: n.inlineTokens(a) };
|
|
29183
|
+
return n.state.inLink = false, o;
|
|
29177
29184
|
}
|
|
29178
|
-
function
|
|
29185
|
+
function Je(u, e, t) {
|
|
29179
29186
|
let n = u.match(t.other.indentCodeCompensation);
|
|
29180
29187
|
if (n === null)
|
|
29181
29188
|
return e;
|
|
@@ -29185,8 +29192,8 @@ function Ve(u, e, t) {
|
|
|
29185
29192
|
let s = i.match(t.other.beginningSpace);
|
|
29186
29193
|
if (s === null)
|
|
29187
29194
|
return i;
|
|
29188
|
-
let [
|
|
29189
|
-
return
|
|
29195
|
+
let [a] = s;
|
|
29196
|
+
return a.length >= r.length ? i.slice(r.length) : i;
|
|
29190
29197
|
}).join(`
|
|
29191
29198
|
`);
|
|
29192
29199
|
}
|
|
@@ -29213,7 +29220,7 @@ var y = class {
|
|
|
29213
29220
|
fences(e) {
|
|
29214
29221
|
let t = this.rules.block.fences.exec(e);
|
|
29215
29222
|
if (t) {
|
|
29216
|
-
let n = t[0], r =
|
|
29223
|
+
let n = t[0], r = Je(n, t[3] || "", this.rules);
|
|
29217
29224
|
return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: r };
|
|
29218
29225
|
}
|
|
29219
29226
|
}
|
|
@@ -29241,38 +29248,38 @@ var y = class {
|
|
|
29241
29248
|
`).split(`
|
|
29242
29249
|
`), r = "", i = "", s = [];
|
|
29243
29250
|
for (;n.length > 0; ) {
|
|
29244
|
-
let
|
|
29251
|
+
let a = false, o = [], l;
|
|
29245
29252
|
for (l = 0;l < n.length; l++)
|
|
29246
29253
|
if (this.rules.other.blockquoteStart.test(n[l]))
|
|
29247
|
-
|
|
29248
|
-
else if (!
|
|
29249
|
-
|
|
29254
|
+
o.push(n[l]), a = true;
|
|
29255
|
+
else if (!a)
|
|
29256
|
+
o.push(n[l]);
|
|
29250
29257
|
else
|
|
29251
29258
|
break;
|
|
29252
29259
|
n = n.slice(l);
|
|
29253
|
-
let
|
|
29254
|
-
`),
|
|
29260
|
+
let p = o.join(`
|
|
29261
|
+
`), c = p.replace(this.rules.other.blockquoteSetextReplace, `
|
|
29255
29262
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
29256
29263
|
r = r ? `${r}
|
|
29257
|
-
${
|
|
29258
|
-
${
|
|
29264
|
+
${p}` : p, i = i ? `${i}
|
|
29265
|
+
${c}` : c;
|
|
29259
29266
|
let g = this.lexer.state.top;
|
|
29260
|
-
if (this.lexer.state.top = true, this.lexer.blockTokens(
|
|
29267
|
+
if (this.lexer.state.top = true, this.lexer.blockTokens(c, s, true), this.lexer.state.top = g, n.length === 0)
|
|
29261
29268
|
break;
|
|
29262
|
-
let
|
|
29263
|
-
if (
|
|
29269
|
+
let h = s.at(-1);
|
|
29270
|
+
if (h?.type === "code")
|
|
29264
29271
|
break;
|
|
29265
|
-
if (
|
|
29266
|
-
let R =
|
|
29272
|
+
if (h?.type === "blockquote") {
|
|
29273
|
+
let R = h, f = R.raw + `
|
|
29267
29274
|
` + n.join(`
|
|
29268
29275
|
`), O = this.blockquote(f);
|
|
29269
29276
|
s[s.length - 1] = O, r = r.substring(0, r.length - R.raw.length) + O.raw, i = i.substring(0, i.length - R.text.length) + O.text;
|
|
29270
29277
|
break;
|
|
29271
|
-
} else if (
|
|
29272
|
-
let R =
|
|
29278
|
+
} else if (h?.type === "list") {
|
|
29279
|
+
let R = h, f = R.raw + `
|
|
29273
29280
|
` + n.join(`
|
|
29274
29281
|
`), O = this.list(f);
|
|
29275
|
-
s[s.length - 1] = O, r = r.substring(0, r.length -
|
|
29282
|
+
s[s.length - 1] = O, r = r.substring(0, r.length - h.raw.length) + O.raw, i = i.substring(0, i.length - R.raw.length) + O.raw, n = f.substring(s.at(-1).raw.length).split(`
|
|
29276
29283
|
`);
|
|
29277
29284
|
continue;
|
|
29278
29285
|
}
|
|
@@ -29285,54 +29292,71 @@ ${p}` : p;
|
|
|
29285
29292
|
if (t) {
|
|
29286
29293
|
let n = t[1].trim(), r = n.length > 1, i = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: false, items: [] };
|
|
29287
29294
|
n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
|
|
29288
|
-
let s = this.rules.other.listItemRegex(n),
|
|
29295
|
+
let s = this.rules.other.listItemRegex(n), a = false;
|
|
29289
29296
|
for (;e; ) {
|
|
29290
|
-
let l = false,
|
|
29297
|
+
let l = false, p = "", c = "";
|
|
29291
29298
|
if (!(t = s.exec(e)) || this.rules.block.hr.test(e))
|
|
29292
29299
|
break;
|
|
29293
|
-
|
|
29300
|
+
p = t[0], e = e.substring(p.length);
|
|
29294
29301
|
let g = t[2].split(`
|
|
29295
|
-
`, 1)[0].replace(this.rules.other.listReplaceTabs, (
|
|
29302
|
+
`, 1)[0].replace(this.rules.other.listReplaceTabs, (O) => " ".repeat(3 * O.length)), h = e.split(`
|
|
29296
29303
|
`, 1)[0], R = !g.trim(), f = 0;
|
|
29297
|
-
if (this.options.pedantic ? (f = 2,
|
|
29298
|
-
`, e = e.substring(
|
|
29299
|
-
let
|
|
29304
|
+
if (this.options.pedantic ? (f = 2, c = g.trimStart()) : R ? f = t[1].length + 1 : (f = t[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = g.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(h) && (p += h + `
|
|
29305
|
+
`, e = e.substring(h.length + 1), l = true), !l) {
|
|
29306
|
+
let O = this.rules.other.nextBulletRegex(f), V = this.rules.other.hrRegex(f), Y = this.rules.other.fencesBeginRegex(f), ee = this.rules.other.headingBeginRegex(f), fe = this.rules.other.htmlBeginRegex(f);
|
|
29300
29307
|
for (;e; ) {
|
|
29301
|
-
let
|
|
29308
|
+
let H = e.split(`
|
|
29302
29309
|
`, 1)[0], A;
|
|
29303
|
-
if (
|
|
29310
|
+
if (h = H, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), A = h) : A = h.replace(this.rules.other.tabCharGlobal, " "), Y.test(h) || ee.test(h) || fe.test(h) || O.test(h) || V.test(h))
|
|
29304
29311
|
break;
|
|
29305
|
-
if (A.search(this.rules.other.nonSpaceChar) >= f || !
|
|
29306
|
-
|
|
29312
|
+
if (A.search(this.rules.other.nonSpaceChar) >= f || !h.trim())
|
|
29313
|
+
c += `
|
|
29307
29314
|
` + A.slice(f);
|
|
29308
29315
|
else {
|
|
29309
|
-
if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 ||
|
|
29316
|
+
if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || Y.test(g) || ee.test(g) || V.test(g))
|
|
29310
29317
|
break;
|
|
29311
|
-
|
|
29312
|
-
` +
|
|
29318
|
+
c += `
|
|
29319
|
+
` + h;
|
|
29313
29320
|
}
|
|
29314
|
-
!R && !
|
|
29315
|
-
`, e = e.substring(
|
|
29321
|
+
!R && !h.trim() && (R = true), p += H + `
|
|
29322
|
+
`, e = e.substring(H.length + 1), g = A.slice(f);
|
|
29316
29323
|
}
|
|
29317
29324
|
}
|
|
29318
|
-
i.loose || (
|
|
29319
|
-
let O = null, Y;
|
|
29320
|
-
this.options.gfm && (O = this.rules.other.listIsTask.exec(p), O && (Y = O[0] !== "[ ] ", p = p.replace(this.rules.other.listReplaceTask, ""))), i.items.push({ type: "list_item", raw: c, task: !!O, checked: Y, loose: false, text: p, tokens: [] }), i.raw += c;
|
|
29325
|
+
i.loose || (a ? i.loose = true : this.rules.other.doubleBlankLine.test(p) && (a = true)), i.items.push({ type: "list_item", raw: p, task: !!this.options.gfm && this.rules.other.listIsTask.test(c), loose: false, text: c, tokens: [] }), i.raw += p;
|
|
29321
29326
|
}
|
|
29322
|
-
let
|
|
29323
|
-
if (
|
|
29324
|
-
|
|
29327
|
+
let o = i.items.at(-1);
|
|
29328
|
+
if (o)
|
|
29329
|
+
o.raw = o.raw.trimEnd(), o.text = o.text.trimEnd();
|
|
29325
29330
|
else
|
|
29326
29331
|
return;
|
|
29327
29332
|
i.raw = i.raw.trimEnd();
|
|
29328
|
-
for (let l
|
|
29329
|
-
if (this.lexer.state.top = false,
|
|
29330
|
-
|
|
29331
|
-
|
|
29333
|
+
for (let l of i.items) {
|
|
29334
|
+
if (this.lexer.state.top = false, l.tokens = this.lexer.blockTokens(l.text, []), l.task) {
|
|
29335
|
+
if (l.text = l.text.replace(this.rules.other.listReplaceTask, ""), l.tokens[0]?.type === "text" || l.tokens[0]?.type === "paragraph") {
|
|
29336
|
+
l.tokens[0].raw = l.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), l.tokens[0].text = l.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
|
|
29337
|
+
for (let c = this.lexer.inlineQueue.length - 1;c >= 0; c--)
|
|
29338
|
+
if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)) {
|
|
29339
|
+
this.lexer.inlineQueue[c].src = this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask, "");
|
|
29340
|
+
break;
|
|
29341
|
+
}
|
|
29342
|
+
}
|
|
29343
|
+
let p = this.rules.other.listTaskCheckbox.exec(l.raw);
|
|
29344
|
+
if (p) {
|
|
29345
|
+
let c = { type: "checkbox", raw: p[0] + " ", checked: p[0] !== "[ ]" };
|
|
29346
|
+
l.checked = c.checked, i.loose ? l.tokens[0] && ["paragraph", "text"].includes(l.tokens[0].type) && "tokens" in l.tokens[0] && l.tokens[0].tokens ? (l.tokens[0].raw = c.raw + l.tokens[0].raw, l.tokens[0].text = c.raw + l.tokens[0].text, l.tokens[0].tokens.unshift(c)) : l.tokens.unshift({ type: "paragraph", raw: c.raw, text: c.raw, tokens: [c] }) : l.tokens.unshift(c);
|
|
29347
|
+
}
|
|
29332
29348
|
}
|
|
29349
|
+
if (!i.loose) {
|
|
29350
|
+
let p = l.tokens.filter((g) => g.type === "space"), c = p.length > 0 && p.some((g) => this.rules.other.anyLine.test(g.raw));
|
|
29351
|
+
i.loose = c;
|
|
29352
|
+
}
|
|
29353
|
+
}
|
|
29333
29354
|
if (i.loose)
|
|
29334
|
-
for (let l
|
|
29335
|
-
|
|
29355
|
+
for (let l of i.items) {
|
|
29356
|
+
l.loose = true;
|
|
29357
|
+
for (let p of l.tokens)
|
|
29358
|
+
p.type === "text" && (p.type = "paragraph");
|
|
29359
|
+
}
|
|
29336
29360
|
return i;
|
|
29337
29361
|
}
|
|
29338
29362
|
}
|
|
@@ -29352,15 +29376,15 @@ ${p}` : p;
|
|
|
29352
29376
|
let t = this.rules.block.table.exec(e);
|
|
29353
29377
|
if (!t || !this.rules.other.tableDelimiter.test(t[2]))
|
|
29354
29378
|
return;
|
|
29355
|
-
let n =
|
|
29379
|
+
let n = J(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
29356
29380
|
`) : [], s = { type: "table", raw: t[0], header: [], align: [], rows: [] };
|
|
29357
29381
|
if (n.length === r.length) {
|
|
29358
|
-
for (let
|
|
29359
|
-
this.rules.other.tableAlignRight.test(
|
|
29360
|
-
for (let
|
|
29361
|
-
s.header.push({ text: n[
|
|
29362
|
-
for (let
|
|
29363
|
-
s.rows.push(
|
|
29382
|
+
for (let a of r)
|
|
29383
|
+
this.rules.other.tableAlignRight.test(a) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(a) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(a) ? s.align.push("left") : s.align.push(null);
|
|
29384
|
+
for (let a = 0;a < n.length; a++)
|
|
29385
|
+
s.header.push({ text: n[a], tokens: this.lexer.inline(n[a]), header: true, align: s.align[a] });
|
|
29386
|
+
for (let a of i)
|
|
29387
|
+
s.rows.push(J(a, s.header.length).map((o, l) => ({ text: o, tokens: this.lexer.inline(o), header: false, align: s.align[l] })));
|
|
29364
29388
|
return s;
|
|
29365
29389
|
}
|
|
29366
29390
|
}
|
|
@@ -29403,12 +29427,12 @@ ${p}` : p;
|
|
|
29403
29427
|
if ((n.length - s.length) % 2 === 0)
|
|
29404
29428
|
return;
|
|
29405
29429
|
} else {
|
|
29406
|
-
let s =
|
|
29430
|
+
let s = de(t[2], "()");
|
|
29407
29431
|
if (s === -2)
|
|
29408
29432
|
return;
|
|
29409
29433
|
if (s > -1) {
|
|
29410
|
-
let
|
|
29411
|
-
t[2] = t[2].substring(0, s), t[0] = t[0].substring(0,
|
|
29434
|
+
let o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
|
|
29435
|
+
t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, o).trim(), t[3] = "";
|
|
29412
29436
|
}
|
|
29413
29437
|
}
|
|
29414
29438
|
let r = t[2], i = "";
|
|
@@ -29417,7 +29441,7 @@ ${p}` : p;
|
|
|
29417
29441
|
s && (r = s[1], i = s[3]);
|
|
29418
29442
|
} else
|
|
29419
29443
|
i = t[3] ? t[3].slice(1, -1) : "";
|
|
29420
|
-
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)),
|
|
29444
|
+
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), ge(t, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
|
|
29421
29445
|
}
|
|
29422
29446
|
}
|
|
29423
29447
|
reflink(e, t) {
|
|
@@ -29428,7 +29452,7 @@ ${p}` : p;
|
|
|
29428
29452
|
let s = n[0].charAt(0);
|
|
29429
29453
|
return { type: "text", raw: s, text: s };
|
|
29430
29454
|
}
|
|
29431
|
-
return
|
|
29455
|
+
return ge(n, i, n[0], this.lexer, this.rules);
|
|
29432
29456
|
}
|
|
29433
29457
|
}
|
|
29434
29458
|
emStrong(e, t, n = "") {
|
|
@@ -29436,27 +29460,27 @@ ${p}` : p;
|
|
|
29436
29460
|
if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric))
|
|
29437
29461
|
return;
|
|
29438
29462
|
if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
29439
|
-
let s = [...r[0]].length - 1,
|
|
29440
|
-
for (
|
|
29441
|
-
if (
|
|
29463
|
+
let s = [...r[0]].length - 1, a, o, l = s, p = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
29464
|
+
for (c.lastIndex = 0, t = t.slice(-1 * e.length + s);(r = c.exec(t)) != null; ) {
|
|
29465
|
+
if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a)
|
|
29442
29466
|
continue;
|
|
29443
|
-
if (
|
|
29444
|
-
l +=
|
|
29467
|
+
if (o = [...a].length, r[3] || r[4]) {
|
|
29468
|
+
l += o;
|
|
29445
29469
|
continue;
|
|
29446
|
-
} else if ((r[5] || r[6]) && s % 3 && !((s +
|
|
29447
|
-
|
|
29470
|
+
} else if ((r[5] || r[6]) && s % 3 && !((s + o) % 3)) {
|
|
29471
|
+
p += o;
|
|
29448
29472
|
continue;
|
|
29449
29473
|
}
|
|
29450
|
-
if (l -=
|
|
29474
|
+
if (l -= o, l > 0)
|
|
29451
29475
|
continue;
|
|
29452
|
-
|
|
29453
|
-
let g = [...r[0]][0].length,
|
|
29454
|
-
if (Math.min(s,
|
|
29455
|
-
let f =
|
|
29456
|
-
return { type: "em", raw:
|
|
29476
|
+
o = Math.min(o, o + l + p);
|
|
29477
|
+
let g = [...r[0]][0].length, h = e.slice(0, s + r.index + g + o);
|
|
29478
|
+
if (Math.min(s, o) % 2) {
|
|
29479
|
+
let f = h.slice(1, -1);
|
|
29480
|
+
return { type: "em", raw: h, text: f, tokens: this.lexer.inlineTokens(f) };
|
|
29457
29481
|
}
|
|
29458
|
-
let R =
|
|
29459
|
-
return { type: "strong", raw:
|
|
29482
|
+
let R = h.slice(2, -2);
|
|
29483
|
+
return { type: "strong", raw: h, text: R, tokens: this.lexer.inlineTokens(R) };
|
|
29460
29484
|
}
|
|
29461
29485
|
}
|
|
29462
29486
|
}
|
|
@@ -29512,15 +29536,15 @@ var x = class u {
|
|
|
29512
29536
|
tokens;
|
|
29513
29537
|
options;
|
|
29514
29538
|
state;
|
|
29515
|
-
tokenizer;
|
|
29516
29539
|
inlineQueue;
|
|
29540
|
+
tokenizer;
|
|
29517
29541
|
constructor(e) {
|
|
29518
29542
|
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new y, this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
|
|
29519
|
-
let t = { other: m, block:
|
|
29520
|
-
this.options.pedantic ? (t.block =
|
|
29543
|
+
let t = { other: m, block: E.normal, inline: M.normal };
|
|
29544
|
+
this.options.pedantic ? (t.block = E.pedantic, t.inline = M.pedantic) : this.options.gfm && (t.block = E.gfm, this.options.breaks ? t.inline = M.breaks : t.inline = M.gfm), this.tokenizer.rules = t;
|
|
29521
29545
|
}
|
|
29522
29546
|
static get rules() {
|
|
29523
|
-
return { block:
|
|
29547
|
+
return { block: E, inline: M };
|
|
29524
29548
|
}
|
|
29525
29549
|
static lex(e, t) {
|
|
29526
29550
|
return new u(t).lex(e);
|
|
@@ -29601,9 +29625,9 @@ var x = class u {
|
|
|
29601
29625
|
}
|
|
29602
29626
|
let i = e;
|
|
29603
29627
|
if (this.options.extensions?.startBlock) {
|
|
29604
|
-
let s = 1 / 0,
|
|
29628
|
+
let s = 1 / 0, a = e.slice(1), o;
|
|
29605
29629
|
this.options.extensions.startBlock.forEach((l) => {
|
|
29606
|
-
|
|
29630
|
+
o = l.call({ lexer: this }, a), typeof o == "number" && o >= 0 && (s = Math.min(s, o));
|
|
29607
29631
|
}), s < 1 / 0 && s >= 0 && (i = e.substring(0, s + 1));
|
|
29608
29632
|
}
|
|
29609
29633
|
if (this.state.top && (r = this.tokenizer.paragraph(i))) {
|
|
@@ -29647,14 +29671,15 @@ var x = class u {
|
|
|
29647
29671
|
}
|
|
29648
29672
|
for (;(r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null; )
|
|
29649
29673
|
n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
29674
|
+
let i;
|
|
29650
29675
|
for (;(r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null; )
|
|
29651
|
-
n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
29676
|
+
i = r[2] ? r[2].length : 0, n = n.slice(0, r.index + i) + "[" + "a".repeat(r[0].length - i - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
29652
29677
|
n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
|
|
29653
|
-
let
|
|
29678
|
+
let s = false, a = "";
|
|
29654
29679
|
for (;e; ) {
|
|
29655
|
-
|
|
29680
|
+
s || (a = ""), s = false;
|
|
29656
29681
|
let o;
|
|
29657
|
-
if (this.options.extensions?.inline?.some((
|
|
29682
|
+
if (this.options.extensions?.inline?.some((p) => (o = p.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), true) : false))
|
|
29658
29683
|
continue;
|
|
29659
29684
|
if (o = this.tokenizer.escape(e)) {
|
|
29660
29685
|
e = e.substring(o.raw.length), t.push(o);
|
|
@@ -29670,11 +29695,11 @@ var x = class u {
|
|
|
29670
29695
|
}
|
|
29671
29696
|
if (o = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
29672
29697
|
e = e.substring(o.raw.length);
|
|
29673
|
-
let
|
|
29674
|
-
o.type === "text" &&
|
|
29698
|
+
let p = t.at(-1);
|
|
29699
|
+
o.type === "text" && p?.type === "text" ? (p.raw += o.raw, p.text += o.text) : t.push(o);
|
|
29675
29700
|
continue;
|
|
29676
29701
|
}
|
|
29677
|
-
if (o = this.tokenizer.emStrong(e, n,
|
|
29702
|
+
if (o = this.tokenizer.emStrong(e, n, a)) {
|
|
29678
29703
|
e = e.substring(o.raw.length), t.push(o);
|
|
29679
29704
|
continue;
|
|
29680
29705
|
}
|
|
@@ -29698,26 +29723,26 @@ var x = class u {
|
|
|
29698
29723
|
e = e.substring(o.raw.length), t.push(o);
|
|
29699
29724
|
continue;
|
|
29700
29725
|
}
|
|
29701
|
-
let
|
|
29726
|
+
let l = e;
|
|
29702
29727
|
if (this.options.extensions?.startInline) {
|
|
29703
|
-
let
|
|
29704
|
-
this.options.extensions.startInline.forEach((
|
|
29705
|
-
|
|
29706
|
-
}),
|
|
29707
|
-
}
|
|
29708
|
-
if (o = this.tokenizer.inlineText(
|
|
29709
|
-
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (
|
|
29710
|
-
let
|
|
29711
|
-
|
|
29728
|
+
let p = 1 / 0, c = e.slice(1), g;
|
|
29729
|
+
this.options.extensions.startInline.forEach((h) => {
|
|
29730
|
+
g = h.call({ lexer: this }, c), typeof g == "number" && g >= 0 && (p = Math.min(p, g));
|
|
29731
|
+
}), p < 1 / 0 && p >= 0 && (l = e.substring(0, p + 1));
|
|
29732
|
+
}
|
|
29733
|
+
if (o = this.tokenizer.inlineText(l)) {
|
|
29734
|
+
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (a = o.raw.slice(-1)), s = true;
|
|
29735
|
+
let p = t.at(-1);
|
|
29736
|
+
p?.type === "text" ? (p.raw += o.raw, p.text += o.text) : t.push(o);
|
|
29712
29737
|
continue;
|
|
29713
29738
|
}
|
|
29714
29739
|
if (e) {
|
|
29715
|
-
let
|
|
29740
|
+
let p = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
29716
29741
|
if (this.options.silent) {
|
|
29717
|
-
console.error(
|
|
29742
|
+
console.error(p);
|
|
29718
29743
|
break;
|
|
29719
29744
|
} else
|
|
29720
|
-
throw new Error(
|
|
29745
|
+
throw new Error(p);
|
|
29721
29746
|
}
|
|
29722
29747
|
}
|
|
29723
29748
|
return t;
|
|
@@ -29760,9 +29785,9 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
29760
29785
|
}
|
|
29761
29786
|
list(e) {
|
|
29762
29787
|
let { ordered: t, start: n } = e, r = "";
|
|
29763
|
-
for (let
|
|
29764
|
-
let
|
|
29765
|
-
r += this.listitem(
|
|
29788
|
+
for (let a = 0;a < e.items.length; a++) {
|
|
29789
|
+
let o = e.items[a];
|
|
29790
|
+
r += this.listitem(o);
|
|
29766
29791
|
}
|
|
29767
29792
|
let i = t ? "ol" : "ul", s = t && n !== 1 ? ' start="' + n + '"' : "";
|
|
29768
29793
|
return "<" + i + s + `>
|
|
@@ -29770,16 +29795,11 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
29770
29795
|
`;
|
|
29771
29796
|
}
|
|
29772
29797
|
listitem(e) {
|
|
29773
|
-
|
|
29774
|
-
if (e.task) {
|
|
29775
|
-
let n = this.checkbox({ checked: !!e.checked });
|
|
29776
|
-
e.loose ? e.tokens[0]?.type === "paragraph" ? (e.tokens[0].text = n + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = n + " " + w(e.tokens[0].tokens[0].text), e.tokens[0].tokens[0].escaped = true)) : e.tokens.unshift({ type: "text", raw: n + " ", text: n + " ", escaped: true }) : t += n + " ";
|
|
29777
|
-
}
|
|
29778
|
-
return t += this.parser.parse(e.tokens, !!e.loose), `<li>${t}</li>
|
|
29798
|
+
return `<li>${this.parser.parse(e.tokens)}</li>
|
|
29779
29799
|
`;
|
|
29780
29800
|
}
|
|
29781
29801
|
checkbox({ checked: e }) {
|
|
29782
|
-
return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
|
|
29802
|
+
return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
|
|
29783
29803
|
}
|
|
29784
29804
|
paragraph({ tokens: e }) {
|
|
29785
29805
|
return `<p>${this.parser.parseInline(e)}</p>
|
|
@@ -29794,8 +29814,8 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
29794
29814
|
for (let i = 0;i < e.rows.length; i++) {
|
|
29795
29815
|
let s = e.rows[i];
|
|
29796
29816
|
n = "";
|
|
29797
|
-
for (let
|
|
29798
|
-
n += this.tablecell(s[
|
|
29817
|
+
for (let a = 0;a < s.length; a++)
|
|
29818
|
+
n += this.tablecell(s[a]);
|
|
29799
29819
|
r += this.tablerow({ text: n });
|
|
29800
29820
|
}
|
|
29801
29821
|
return r && (r = `<tbody>${r}</tbody>`), `<table>
|
|
@@ -29830,7 +29850,7 @@ ${e}</tr>
|
|
|
29830
29850
|
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
29831
29851
|
}
|
|
29832
29852
|
link({ href: e, title: t, tokens: n }) {
|
|
29833
|
-
let r = this.parser.parseInline(n), i =
|
|
29853
|
+
let r = this.parser.parseInline(n), i = X(e);
|
|
29834
29854
|
if (i === null)
|
|
29835
29855
|
return r;
|
|
29836
29856
|
e = i;
|
|
@@ -29839,7 +29859,7 @@ ${e}</tr>
|
|
|
29839
29859
|
}
|
|
29840
29860
|
image({ href: e, title: t, text: n, tokens: r }) {
|
|
29841
29861
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
29842
|
-
let i =
|
|
29862
|
+
let i = X(e);
|
|
29843
29863
|
if (i === null)
|
|
29844
29864
|
return w(n);
|
|
29845
29865
|
e = i;
|
|
@@ -29878,6 +29898,9 @@ var $ = class {
|
|
|
29878
29898
|
br() {
|
|
29879
29899
|
return "";
|
|
29880
29900
|
}
|
|
29901
|
+
checkbox({ raw: e }) {
|
|
29902
|
+
return e;
|
|
29903
|
+
}
|
|
29881
29904
|
};
|
|
29882
29905
|
var b = class u2 {
|
|
29883
29906
|
options;
|
|
@@ -29892,85 +29915,85 @@ var b = class u2 {
|
|
|
29892
29915
|
static parseInline(e, t) {
|
|
29893
29916
|
return new u2(t).parseInline(e);
|
|
29894
29917
|
}
|
|
29895
|
-
parse(e
|
|
29896
|
-
let
|
|
29897
|
-
for (let
|
|
29898
|
-
let
|
|
29899
|
-
if (this.options.extensions?.renderers?.[
|
|
29900
|
-
let
|
|
29901
|
-
if (a !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(
|
|
29902
|
-
|
|
29918
|
+
parse(e) {
|
|
29919
|
+
let t = "";
|
|
29920
|
+
for (let n = 0;n < e.length; n++) {
|
|
29921
|
+
let r = e[n];
|
|
29922
|
+
if (this.options.extensions?.renderers?.[r.type]) {
|
|
29923
|
+
let s = r, a = this.options.extensions.renderers[s.type].call({ parser: this }, s);
|
|
29924
|
+
if (a !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(s.type)) {
|
|
29925
|
+
t += a || "";
|
|
29903
29926
|
continue;
|
|
29904
29927
|
}
|
|
29905
29928
|
}
|
|
29906
|
-
let
|
|
29907
|
-
switch (
|
|
29929
|
+
let i = r;
|
|
29930
|
+
switch (i.type) {
|
|
29908
29931
|
case "space": {
|
|
29909
|
-
|
|
29910
|
-
|
|
29932
|
+
t += this.renderer.space(i);
|
|
29933
|
+
break;
|
|
29911
29934
|
}
|
|
29912
29935
|
case "hr": {
|
|
29913
|
-
|
|
29914
|
-
|
|
29936
|
+
t += this.renderer.hr(i);
|
|
29937
|
+
break;
|
|
29915
29938
|
}
|
|
29916
29939
|
case "heading": {
|
|
29917
|
-
|
|
29918
|
-
|
|
29940
|
+
t += this.renderer.heading(i);
|
|
29941
|
+
break;
|
|
29919
29942
|
}
|
|
29920
29943
|
case "code": {
|
|
29921
|
-
|
|
29922
|
-
|
|
29944
|
+
t += this.renderer.code(i);
|
|
29945
|
+
break;
|
|
29923
29946
|
}
|
|
29924
29947
|
case "table": {
|
|
29925
|
-
|
|
29926
|
-
|
|
29948
|
+
t += this.renderer.table(i);
|
|
29949
|
+
break;
|
|
29927
29950
|
}
|
|
29928
29951
|
case "blockquote": {
|
|
29929
|
-
|
|
29930
|
-
|
|
29952
|
+
t += this.renderer.blockquote(i);
|
|
29953
|
+
break;
|
|
29931
29954
|
}
|
|
29932
29955
|
case "list": {
|
|
29933
|
-
|
|
29934
|
-
|
|
29956
|
+
t += this.renderer.list(i);
|
|
29957
|
+
break;
|
|
29958
|
+
}
|
|
29959
|
+
case "checkbox": {
|
|
29960
|
+
t += this.renderer.checkbox(i);
|
|
29961
|
+
break;
|
|
29935
29962
|
}
|
|
29936
29963
|
case "html": {
|
|
29937
|
-
|
|
29938
|
-
|
|
29964
|
+
t += this.renderer.html(i);
|
|
29965
|
+
break;
|
|
29939
29966
|
}
|
|
29940
29967
|
case "def": {
|
|
29941
|
-
|
|
29942
|
-
|
|
29968
|
+
t += this.renderer.def(i);
|
|
29969
|
+
break;
|
|
29943
29970
|
}
|
|
29944
29971
|
case "paragraph": {
|
|
29945
|
-
|
|
29946
|
-
|
|
29972
|
+
t += this.renderer.paragraph(i);
|
|
29973
|
+
break;
|
|
29947
29974
|
}
|
|
29948
29975
|
case "text": {
|
|
29949
|
-
|
|
29950
|
-
|
|
29951
|
-
o = e[++r], a += `
|
|
29952
|
-
` + this.renderer.text(o);
|
|
29953
|
-
t ? n += this.renderer.paragraph({ type: "paragraph", raw: a, text: a, tokens: [{ type: "text", raw: a, text: a, escaped: true }] }) : n += a;
|
|
29954
|
-
continue;
|
|
29976
|
+
t += this.renderer.text(i);
|
|
29977
|
+
break;
|
|
29955
29978
|
}
|
|
29956
29979
|
default: {
|
|
29957
|
-
let
|
|
29980
|
+
let s = 'Token with "' + i.type + '" type was not found.';
|
|
29958
29981
|
if (this.options.silent)
|
|
29959
|
-
return console.error(
|
|
29960
|
-
throw new Error(
|
|
29982
|
+
return console.error(s), "";
|
|
29983
|
+
throw new Error(s);
|
|
29961
29984
|
}
|
|
29962
29985
|
}
|
|
29963
29986
|
}
|
|
29964
|
-
return
|
|
29987
|
+
return t;
|
|
29965
29988
|
}
|
|
29966
29989
|
parseInline(e, t = this.renderer) {
|
|
29967
29990
|
let n = "";
|
|
29968
29991
|
for (let r = 0;r < e.length; r++) {
|
|
29969
29992
|
let i = e[r];
|
|
29970
29993
|
if (this.options.extensions?.renderers?.[i.type]) {
|
|
29971
|
-
let
|
|
29972
|
-
if (
|
|
29973
|
-
n +=
|
|
29994
|
+
let a = this.options.extensions.renderers[i.type].call({ parser: this }, i);
|
|
29995
|
+
if (a !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
|
|
29996
|
+
n += a || "";
|
|
29974
29997
|
continue;
|
|
29975
29998
|
}
|
|
29976
29999
|
}
|
|
@@ -29992,6 +30015,10 @@ var b = class u2 {
|
|
|
29992
30015
|
n += t.image(s);
|
|
29993
30016
|
break;
|
|
29994
30017
|
}
|
|
30018
|
+
case "checkbox": {
|
|
30019
|
+
n += t.checkbox(s);
|
|
30020
|
+
break;
|
|
30021
|
+
}
|
|
29995
30022
|
case "strong": {
|
|
29996
30023
|
n += t.strong(s);
|
|
29997
30024
|
break;
|
|
@@ -30017,10 +30044,10 @@ var b = class u2 {
|
|
|
30017
30044
|
break;
|
|
30018
30045
|
}
|
|
30019
30046
|
default: {
|
|
30020
|
-
let
|
|
30047
|
+
let a = 'Token with "' + s.type + '" type was not found.';
|
|
30021
30048
|
if (this.options.silent)
|
|
30022
|
-
return console.error(
|
|
30023
|
-
throw new Error(
|
|
30049
|
+
return console.error(a), "";
|
|
30050
|
+
throw new Error(a);
|
|
30024
30051
|
}
|
|
30025
30052
|
}
|
|
30026
30053
|
}
|
|
@@ -30077,8 +30104,8 @@ var B = class {
|
|
|
30077
30104
|
for (let s of i.header)
|
|
30078
30105
|
n = n.concat(this.walkTokens(s.tokens, t));
|
|
30079
30106
|
for (let s of i.rows)
|
|
30080
|
-
for (let
|
|
30081
|
-
n = n.concat(this.walkTokens(
|
|
30107
|
+
for (let a of s)
|
|
30108
|
+
n = n.concat(this.walkTokens(a.tokens, t));
|
|
30082
30109
|
break;
|
|
30083
30110
|
}
|
|
30084
30111
|
case "list": {
|
|
@@ -30089,8 +30116,8 @@ var B = class {
|
|
|
30089
30116
|
default: {
|
|
30090
30117
|
let i = r;
|
|
30091
30118
|
this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((s) => {
|
|
30092
|
-
let
|
|
30093
|
-
n = n.concat(this.walkTokens(
|
|
30119
|
+
let a = i[s].flat(1 / 0);
|
|
30120
|
+
n = n.concat(this.walkTokens(a, t));
|
|
30094
30121
|
}) : i.tokens && (n = n.concat(this.walkTokens(i.tokens, t)));
|
|
30095
30122
|
}
|
|
30096
30123
|
}
|
|
@@ -30105,9 +30132,9 @@ var B = class {
|
|
|
30105
30132
|
throw new Error("extension name required");
|
|
30106
30133
|
if ("renderer" in i) {
|
|
30107
30134
|
let s = t.renderers[i.name];
|
|
30108
|
-
s ? t.renderers[i.name] = function(...
|
|
30109
|
-
let
|
|
30110
|
-
return
|
|
30135
|
+
s ? t.renderers[i.name] = function(...a) {
|
|
30136
|
+
let o = i.renderer.apply(this, a);
|
|
30137
|
+
return o === false && (o = s.apply(this, a)), o;
|
|
30111
30138
|
} : t.renderers[i.name] = i.renderer;
|
|
30112
30139
|
}
|
|
30113
30140
|
if ("tokenizer" in i) {
|
|
@@ -30124,10 +30151,10 @@ var B = class {
|
|
|
30124
30151
|
throw new Error(`renderer '${s}' does not exist`);
|
|
30125
30152
|
if (["options", "parser"].includes(s))
|
|
30126
30153
|
continue;
|
|
30127
|
-
let
|
|
30128
|
-
i[
|
|
30129
|
-
let
|
|
30130
|
-
return
|
|
30154
|
+
let a = s, o = n.renderer[a], l = i[a];
|
|
30155
|
+
i[a] = (...p) => {
|
|
30156
|
+
let c = o.apply(i, p);
|
|
30157
|
+
return c === false && (c = l.apply(i, p)), c || "";
|
|
30131
30158
|
};
|
|
30132
30159
|
}
|
|
30133
30160
|
r.renderer = i;
|
|
@@ -30139,10 +30166,10 @@ var B = class {
|
|
|
30139
30166
|
throw new Error(`tokenizer '${s}' does not exist`);
|
|
30140
30167
|
if (["options", "rules", "lexer"].includes(s))
|
|
30141
30168
|
continue;
|
|
30142
|
-
let
|
|
30143
|
-
i[
|
|
30144
|
-
let
|
|
30145
|
-
return
|
|
30169
|
+
let a = s, o = n.tokenizer[a], l = i[a];
|
|
30170
|
+
i[a] = (...p) => {
|
|
30171
|
+
let c = o.apply(i, p);
|
|
30172
|
+
return c === false && (c = l.apply(i, p)), c;
|
|
30146
30173
|
};
|
|
30147
30174
|
}
|
|
30148
30175
|
r.tokenizer = i;
|
|
@@ -30154,32 +30181,32 @@ var B = class {
|
|
|
30154
30181
|
throw new Error(`hook '${s}' does not exist`);
|
|
30155
30182
|
if (["options", "block"].includes(s))
|
|
30156
30183
|
continue;
|
|
30157
|
-
let
|
|
30158
|
-
S.passThroughHooks.has(s) ? i[
|
|
30184
|
+
let a = s, o = n.hooks[a], l = i[a];
|
|
30185
|
+
S.passThroughHooks.has(s) ? i[a] = (p) => {
|
|
30159
30186
|
if (this.defaults.async && S.passThroughHooksRespectAsync.has(s))
|
|
30160
30187
|
return (async () => {
|
|
30161
|
-
let g = await
|
|
30188
|
+
let g = await o.call(i, p);
|
|
30162
30189
|
return l.call(i, g);
|
|
30163
30190
|
})();
|
|
30164
|
-
let
|
|
30165
|
-
return l.call(i,
|
|
30166
|
-
} : i[
|
|
30191
|
+
let c = o.call(i, p);
|
|
30192
|
+
return l.call(i, c);
|
|
30193
|
+
} : i[a] = (...p) => {
|
|
30167
30194
|
if (this.defaults.async)
|
|
30168
30195
|
return (async () => {
|
|
30169
|
-
let g = await
|
|
30170
|
-
return g === false && (g = await l.apply(i,
|
|
30196
|
+
let g = await o.apply(i, p);
|
|
30197
|
+
return g === false && (g = await l.apply(i, p)), g;
|
|
30171
30198
|
})();
|
|
30172
|
-
let
|
|
30173
|
-
return
|
|
30199
|
+
let c = o.apply(i, p);
|
|
30200
|
+
return c === false && (c = l.apply(i, p)), c;
|
|
30174
30201
|
};
|
|
30175
30202
|
}
|
|
30176
30203
|
r.hooks = i;
|
|
30177
30204
|
}
|
|
30178
30205
|
if (n.walkTokens) {
|
|
30179
30206
|
let i = this.defaults.walkTokens, s = n.walkTokens;
|
|
30180
|
-
r.walkTokens = function(
|
|
30181
|
-
let
|
|
30182
|
-
return
|
|
30207
|
+
r.walkTokens = function(a) {
|
|
30208
|
+
let o = [];
|
|
30209
|
+
return o.push(s.call(this, a)), i && (o = o.concat(i.call(this, a))), o;
|
|
30183
30210
|
};
|
|
30184
30211
|
}
|
|
30185
30212
|
this.defaults = { ...this.defaults, ...r };
|
|
@@ -30196,28 +30223,28 @@ var B = class {
|
|
|
30196
30223
|
}
|
|
30197
30224
|
parseMarkdown(e) {
|
|
30198
30225
|
return (n, r) => {
|
|
30199
|
-
let i = { ...r }, s = { ...this.defaults, ...i },
|
|
30226
|
+
let i = { ...r }, s = { ...this.defaults, ...i }, a = this.onError(!!s.silent, !!s.async);
|
|
30200
30227
|
if (this.defaults.async === true && i.async === false)
|
|
30201
|
-
return
|
|
30228
|
+
return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
30202
30229
|
if (typeof n > "u" || n === null)
|
|
30203
|
-
return
|
|
30230
|
+
return a(new Error("marked(): input parameter is undefined or null"));
|
|
30204
30231
|
if (typeof n != "string")
|
|
30205
|
-
return
|
|
30232
|
+
return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
|
|
30206
30233
|
if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async)
|
|
30207
30234
|
return (async () => {
|
|
30208
|
-
let
|
|
30209
|
-
s.walkTokens && await Promise.all(this.walkTokens(
|
|
30210
|
-
let
|
|
30211
|
-
return s.hooks ? await s.hooks.postprocess(
|
|
30212
|
-
})().catch(
|
|
30235
|
+
let o = s.hooks ? await s.hooks.preprocess(n) : n, p = await (s.hooks ? await s.hooks.provideLexer() : e ? x.lex : x.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
|
|
30236
|
+
s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
|
|
30237
|
+
let h = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(c, s);
|
|
30238
|
+
return s.hooks ? await s.hooks.postprocess(h) : h;
|
|
30239
|
+
})().catch(a);
|
|
30213
30240
|
try {
|
|
30214
30241
|
s.hooks && (n = s.hooks.preprocess(n));
|
|
30215
30242
|
let l = (s.hooks ? s.hooks.provideLexer() : e ? x.lex : x.lexInline)(n, s);
|
|
30216
30243
|
s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
|
|
30217
|
-
let
|
|
30218
|
-
return s.hooks && (
|
|
30219
|
-
} catch (
|
|
30220
|
-
return o
|
|
30244
|
+
let c = (s.hooks ? s.hooks.provideParser() : e ? b.parse : b.parseInline)(l, s);
|
|
30245
|
+
return s.hooks && (c = s.hooks.postprocess(c)), c;
|
|
30246
|
+
} catch (o) {
|
|
30247
|
+
return a(o);
|
|
30221
30248
|
}
|
|
30222
30249
|
};
|
|
30223
30250
|
}
|
|
@@ -30235,37 +30262,37 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
30235
30262
|
}
|
|
30236
30263
|
};
|
|
30237
30264
|
var _ = new B;
|
|
30238
|
-
function
|
|
30265
|
+
function d(u3, e) {
|
|
30239
30266
|
return _.parse(u3, e);
|
|
30240
30267
|
}
|
|
30241
|
-
|
|
30242
|
-
return _.setOptions(u3),
|
|
30268
|
+
d.options = d.setOptions = function(u3) {
|
|
30269
|
+
return _.setOptions(u3), d.defaults = _.defaults, Z(d.defaults), d;
|
|
30243
30270
|
};
|
|
30244
|
-
|
|
30245
|
-
|
|
30246
|
-
|
|
30247
|
-
return _.use(...u3),
|
|
30271
|
+
d.getDefaults = L;
|
|
30272
|
+
d.defaults = T;
|
|
30273
|
+
d.use = function(...u3) {
|
|
30274
|
+
return _.use(...u3), d.defaults = _.defaults, Z(d.defaults), d;
|
|
30248
30275
|
};
|
|
30249
|
-
|
|
30276
|
+
d.walkTokens = function(u3, e) {
|
|
30250
30277
|
return _.walkTokens(u3, e);
|
|
30251
30278
|
};
|
|
30252
|
-
|
|
30253
|
-
|
|
30254
|
-
|
|
30255
|
-
|
|
30256
|
-
|
|
30257
|
-
|
|
30258
|
-
|
|
30259
|
-
|
|
30260
|
-
|
|
30261
|
-
|
|
30262
|
-
var
|
|
30263
|
-
var
|
|
30264
|
-
var
|
|
30265
|
-
var
|
|
30266
|
-
var
|
|
30267
|
-
var
|
|
30268
|
-
var
|
|
30279
|
+
d.parseInline = _.parseInline;
|
|
30280
|
+
d.Parser = b;
|
|
30281
|
+
d.parser = b.parse;
|
|
30282
|
+
d.Renderer = P;
|
|
30283
|
+
d.TextRenderer = $;
|
|
30284
|
+
d.Lexer = x;
|
|
30285
|
+
d.lexer = x.lex;
|
|
30286
|
+
d.Tokenizer = y;
|
|
30287
|
+
d.Hooks = S;
|
|
30288
|
+
d.parse = d;
|
|
30289
|
+
var Dt = d.options;
|
|
30290
|
+
var Ht = d.setOptions;
|
|
30291
|
+
var Zt = d.use;
|
|
30292
|
+
var Gt = d.walkTokens;
|
|
30293
|
+
var Nt = d.parseInline;
|
|
30294
|
+
var Ft = b.parse;
|
|
30295
|
+
var jt = x.lex;
|
|
30269
30296
|
|
|
30270
30297
|
// node_modules/marked-highlight/src/index.js
|
|
30271
30298
|
function markedHighlight(options2) {
|
|
@@ -30432,8 +30459,8 @@ function extractExcerpt(content, maxLength = 200) {
|
|
|
30432
30459
|
return truncated.substring(0, lastSpace) + "...";
|
|
30433
30460
|
}
|
|
30434
30461
|
function convertMarkdownToHtml(markdownContent) {
|
|
30435
|
-
const html = marked.parse(markdownContent);
|
|
30436
|
-
let sanitized = import_sanitize_html.default(html
|
|
30462
|
+
const html = marked.parse(markdownContent, { async: false });
|
|
30463
|
+
let sanitized = import_sanitize_html.default(html, {
|
|
30437
30464
|
allowedTags: import_sanitize_html.default.defaults.allowedTags.concat([
|
|
30438
30465
|
"img",
|
|
30439
30466
|
"h1",
|
|
@@ -30856,6 +30883,152 @@ function getDefaultCSSConfig() {
|
|
|
30856
30883
|
};
|
|
30857
30884
|
}
|
|
30858
30885
|
|
|
30886
|
+
// src/utils/json-ld.ts
|
|
30887
|
+
function generateOrganizationSchema(site) {
|
|
30888
|
+
const organization = {
|
|
30889
|
+
"@context": "https://schema.org",
|
|
30890
|
+
"@type": "Organization",
|
|
30891
|
+
name: site.title,
|
|
30892
|
+
url: site.baseUrl
|
|
30893
|
+
};
|
|
30894
|
+
if (site.description) {
|
|
30895
|
+
organization.description = site.description;
|
|
30896
|
+
}
|
|
30897
|
+
return organization;
|
|
30898
|
+
}
|
|
30899
|
+
function generateBlogPostingSchema(options2) {
|
|
30900
|
+
const { post, site, imageUrl, dateModified } = options2;
|
|
30901
|
+
const postUrl = `${site.baseUrl}${post.url}`;
|
|
30902
|
+
const blogPosting = {
|
|
30903
|
+
"@context": "https://schema.org",
|
|
30904
|
+
"@type": "BlogPosting",
|
|
30905
|
+
headline: post.title,
|
|
30906
|
+
description: post.excerpt,
|
|
30907
|
+
url: postUrl,
|
|
30908
|
+
mainEntityOfPage: {
|
|
30909
|
+
"@type": "WebPage",
|
|
30910
|
+
"@id": postUrl
|
|
30911
|
+
},
|
|
30912
|
+
datePublished: post.date,
|
|
30913
|
+
dateModified: dateModified || post.date
|
|
30914
|
+
};
|
|
30915
|
+
if (site.authorName) {
|
|
30916
|
+
blogPosting.author = {
|
|
30917
|
+
"@type": "Person",
|
|
30918
|
+
name: site.authorName,
|
|
30919
|
+
...site.authorEmail && { email: site.authorEmail }
|
|
30920
|
+
};
|
|
30921
|
+
}
|
|
30922
|
+
blogPosting.publisher = {
|
|
30923
|
+
"@type": "Organization",
|
|
30924
|
+
name: site.title,
|
|
30925
|
+
url: site.baseUrl
|
|
30926
|
+
};
|
|
30927
|
+
if (imageUrl) {
|
|
30928
|
+
blogPosting.image = imageUrl;
|
|
30929
|
+
}
|
|
30930
|
+
if (post.tags && post.tags.length > 0) {
|
|
30931
|
+
blogPosting.keywords = post.tags.join(", ");
|
|
30932
|
+
}
|
|
30933
|
+
if (post.tags && post.tags.length > 0) {
|
|
30934
|
+
blogPosting.articleSection = post.tags[0];
|
|
30935
|
+
}
|
|
30936
|
+
if (post.content) {
|
|
30937
|
+
const wordCount = post.content.split(/\s+/).length;
|
|
30938
|
+
blogPosting.wordCount = wordCount;
|
|
30939
|
+
}
|
|
30940
|
+
blogPosting.inLanguage = site.rssLanguage || "en-US";
|
|
30941
|
+
return blogPosting;
|
|
30942
|
+
}
|
|
30943
|
+
function generateWebSiteSchema(options2) {
|
|
30944
|
+
const { site } = options2;
|
|
30945
|
+
const webSite = {
|
|
30946
|
+
"@context": "https://schema.org",
|
|
30947
|
+
"@type": "WebSite",
|
|
30948
|
+
name: site.title,
|
|
30949
|
+
url: site.baseUrl
|
|
30950
|
+
};
|
|
30951
|
+
if (site.description) {
|
|
30952
|
+
webSite.description = site.description;
|
|
30953
|
+
}
|
|
30954
|
+
webSite.potentialAction = {
|
|
30955
|
+
"@type": "SearchAction",
|
|
30956
|
+
target: {
|
|
30957
|
+
"@type": "EntryPoint",
|
|
30958
|
+
urlTemplate: `${site.baseUrl}/search?q={search_term_string}`
|
|
30959
|
+
},
|
|
30960
|
+
"query-input": "required name=search_term_string"
|
|
30961
|
+
};
|
|
30962
|
+
return webSite;
|
|
30963
|
+
}
|
|
30964
|
+
function generateBreadcrumbListSchema(options2) {
|
|
30965
|
+
const { site, post, items } = options2;
|
|
30966
|
+
const breadcrumbs = {
|
|
30967
|
+
"@context": "https://schema.org",
|
|
30968
|
+
"@type": "BreadcrumbList",
|
|
30969
|
+
itemListElement: []
|
|
30970
|
+
};
|
|
30971
|
+
if (items && items.length > 0) {
|
|
30972
|
+
breadcrumbs.itemListElement = items.map((item, index) => ({
|
|
30973
|
+
"@type": "ListItem",
|
|
30974
|
+
position: index + 1,
|
|
30975
|
+
name: item.name,
|
|
30976
|
+
item: item.url
|
|
30977
|
+
}));
|
|
30978
|
+
return breadcrumbs;
|
|
30979
|
+
}
|
|
30980
|
+
const homeItem = {
|
|
30981
|
+
"@type": "ListItem",
|
|
30982
|
+
position: 1,
|
|
30983
|
+
name: "Home",
|
|
30984
|
+
item: site.baseUrl
|
|
30985
|
+
};
|
|
30986
|
+
breadcrumbs.itemListElement.push(homeItem);
|
|
30987
|
+
if (post) {
|
|
30988
|
+
breadcrumbs.itemListElement.push({
|
|
30989
|
+
"@type": "ListItem",
|
|
30990
|
+
position: 2,
|
|
30991
|
+
name: post.title,
|
|
30992
|
+
item: `${site.baseUrl}${post.url}`
|
|
30993
|
+
});
|
|
30994
|
+
}
|
|
30995
|
+
return breadcrumbs;
|
|
30996
|
+
}
|
|
30997
|
+
function toScriptTag(jsonLd) {
|
|
30998
|
+
const json2 = JSON.stringify(jsonLd, null, 2);
|
|
30999
|
+
return `<script type="application/ld+json">
|
|
31000
|
+
${json2}
|
|
31001
|
+
</script>`;
|
|
31002
|
+
}
|
|
31003
|
+
function extractFirstImageUrl(html, baseUrl) {
|
|
31004
|
+
const imgMatch = html.match(/<img[^>]+src=["']([^"']+)["']/i);
|
|
31005
|
+
if (!imgMatch || !imgMatch[1]) {
|
|
31006
|
+
return;
|
|
31007
|
+
}
|
|
31008
|
+
const src = imgMatch[1];
|
|
31009
|
+
if (src.startsWith("http://") || src.startsWith("https://")) {
|
|
31010
|
+
return src;
|
|
31011
|
+
}
|
|
31012
|
+
const cleanBaseUrl = baseUrl.replace(/\/$/, "");
|
|
31013
|
+
const cleanSrc = src.startsWith("/") ? src : `/${src}`;
|
|
31014
|
+
return `${cleanBaseUrl}${cleanSrc}`;
|
|
31015
|
+
}
|
|
31016
|
+
function generatePostPageSchemas(options2) {
|
|
31017
|
+
const schemas = [];
|
|
31018
|
+
schemas.push(generateBlogPostingSchema(options2));
|
|
31019
|
+
schemas.push(generateBreadcrumbListSchema({
|
|
31020
|
+
site: options2.site,
|
|
31021
|
+
post: options2.post
|
|
31022
|
+
}));
|
|
31023
|
+
return schemas;
|
|
31024
|
+
}
|
|
31025
|
+
function generateHomePageSchemas(options2) {
|
|
31026
|
+
const schemas = [];
|
|
31027
|
+
schemas.push(generateWebSiteSchema(options2));
|
|
31028
|
+
schemas.push(generateOrganizationSchema(options2.site));
|
|
31029
|
+
return schemas;
|
|
31030
|
+
}
|
|
31031
|
+
|
|
30859
31032
|
// src/site-generator.ts
|
|
30860
31033
|
class SiteGenerator {
|
|
30861
31034
|
options;
|
|
@@ -30905,7 +31078,7 @@ class SiteGenerator {
|
|
|
30905
31078
|
const pstDate = new Date(date).toLocaleString("en-US", {
|
|
30906
31079
|
timeZone: "America/Los_Angeles"
|
|
30907
31080
|
});
|
|
30908
|
-
const
|
|
31081
|
+
const d2 = new Date(pstDate);
|
|
30909
31082
|
const months = [
|
|
30910
31083
|
"January",
|
|
30911
31084
|
"February",
|
|
@@ -30921,15 +31094,15 @@ class SiteGenerator {
|
|
|
30921
31094
|
"December"
|
|
30922
31095
|
];
|
|
30923
31096
|
if (format === "YYYY") {
|
|
30924
|
-
return
|
|
31097
|
+
return d2.getFullYear();
|
|
30925
31098
|
} else if (format === "MMMM D, YYYY") {
|
|
30926
|
-
return `${months[
|
|
31099
|
+
return `${months[d2.getMonth()]} ${d2.getDate()}, ${d2.getFullYear()}`;
|
|
30927
31100
|
} else if (format === "MMMM D, YYYY h:mm A") {
|
|
30928
|
-
const hours =
|
|
30929
|
-
const ampm =
|
|
30930
|
-
return `${months[
|
|
31101
|
+
const hours = d2.getHours() % 12 || 12;
|
|
31102
|
+
const ampm = d2.getHours() >= 12 ? "PM" : "AM";
|
|
31103
|
+
return `${months[d2.getMonth()]} ${d2.getDate()}, ${d2.getFullYear()} @ ${hours} ${ampm}`;
|
|
30931
31104
|
} else {
|
|
30932
|
-
return
|
|
31105
|
+
return d2.toLocaleDateString("en-US", {
|
|
30933
31106
|
timeZone: "America/Los_Angeles"
|
|
30934
31107
|
});
|
|
30935
31108
|
}
|
|
@@ -31041,11 +31214,20 @@ class SiteGenerator {
|
|
|
31041
31214
|
const endIndex = startIndex + pageSize;
|
|
31042
31215
|
const paginatedPosts = this.site.posts.slice(startIndex, endIndex);
|
|
31043
31216
|
const pagination = this.createPagination(this.site.posts, page, pageSize, "/");
|
|
31217
|
+
let jsonLd = "";
|
|
31218
|
+
if (page === 1) {
|
|
31219
|
+
const schemas = generateHomePageSchemas({
|
|
31220
|
+
site: this.options.config
|
|
31221
|
+
});
|
|
31222
|
+
jsonLd = schemas.map((schema) => toScriptTag(schema)).join(`
|
|
31223
|
+
`);
|
|
31224
|
+
}
|
|
31044
31225
|
const pageHtml = import_nunjucks.default.render("index.njk", {
|
|
31045
31226
|
site: this.options.config,
|
|
31046
31227
|
posts: paginatedPosts,
|
|
31047
31228
|
tags: this.getSortedTags(this.options.config.maxTagsOnHomepage),
|
|
31048
|
-
pagination
|
|
31229
|
+
pagination,
|
|
31230
|
+
jsonLd
|
|
31049
31231
|
});
|
|
31050
31232
|
if (page === 1) {
|
|
31051
31233
|
await Bun.write(path5.join(this.options.outputDir, "index.html"), pageHtml);
|
|
@@ -31061,9 +31243,18 @@ class SiteGenerator {
|
|
|
31061
31243
|
const postPath = post.url.substring(1);
|
|
31062
31244
|
const postDir = path5.join(this.options.outputDir, postPath);
|
|
31063
31245
|
await ensureDir(postDir);
|
|
31246
|
+
const imageUrl = extractFirstImageUrl(post.html, this.options.config.baseUrl);
|
|
31247
|
+
const schemas = generatePostPageSchemas({
|
|
31248
|
+
post,
|
|
31249
|
+
site: this.options.config,
|
|
31250
|
+
imageUrl
|
|
31251
|
+
});
|
|
31252
|
+
const jsonLd = schemas.map((schema) => toScriptTag(schema)).join(`
|
|
31253
|
+
`);
|
|
31064
31254
|
const postHtml = import_nunjucks.default.render("post.njk", {
|
|
31065
31255
|
site: this.options.config,
|
|
31066
|
-
post
|
|
31256
|
+
post,
|
|
31257
|
+
jsonLd
|
|
31067
31258
|
});
|
|
31068
31259
|
await Bun.write(path5.join(postDir, "index.html"), postHtml);
|
|
31069
31260
|
}
|