bunki 0.4.2 → 0.5.1
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/dist/cli.js +143 -117
- package/dist/index.js +143 -117
- package/dist/types.d.ts +2 -0
- package/dist/utils/markdown-utils.d.ts +1 -0
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -19256,24 +19256,24 @@ var require_lib2 = __commonJS((exports) => {
|
|
|
19256
19256
|
// node_modules/domhandler/lib/node.js
|
|
19257
19257
|
var require_node = __commonJS((exports) => {
|
|
19258
19258
|
var __extends = exports && exports.__extends || function() {
|
|
19259
|
-
var extendStatics = function(
|
|
19260
|
-
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(
|
|
19261
|
-
|
|
19262
|
-
} || function(
|
|
19259
|
+
var extendStatics = function(d, b2) {
|
|
19260
|
+
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b3) {
|
|
19261
|
+
d2.__proto__ = b3;
|
|
19262
|
+
} || function(d2, b3) {
|
|
19263
19263
|
for (var p in b3)
|
|
19264
19264
|
if (Object.prototype.hasOwnProperty.call(b3, p))
|
|
19265
|
-
|
|
19265
|
+
d2[p] = b3[p];
|
|
19266
19266
|
};
|
|
19267
|
-
return extendStatics(
|
|
19267
|
+
return extendStatics(d, b2);
|
|
19268
19268
|
};
|
|
19269
|
-
return function(
|
|
19269
|
+
return function(d, b2) {
|
|
19270
19270
|
if (typeof b2 !== "function" && b2 !== null)
|
|
19271
19271
|
throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
|
|
19272
|
-
extendStatics(
|
|
19272
|
+
extendStatics(d, b2);
|
|
19273
19273
|
function __() {
|
|
19274
|
-
this.constructor =
|
|
19274
|
+
this.constructor = d;
|
|
19275
19275
|
}
|
|
19276
|
-
|
|
19276
|
+
d.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __);
|
|
19277
19277
|
};
|
|
19278
19278
|
}();
|
|
19279
19279
|
var __assign = exports && exports.__assign || function() {
|
|
@@ -21378,7 +21378,7 @@ var require_parse_srcset = __commonJS((exports, module) => {
|
|
|
21378
21378
|
}
|
|
21379
21379
|
}
|
|
21380
21380
|
function parseDescriptors() {
|
|
21381
|
-
var pError = false, w2,
|
|
21381
|
+
var pError = false, w2, d, h2, i, candidate = {}, desc, lastChar, value, intVal, floatVal;
|
|
21382
21382
|
for (i = 0;i < descriptors.length; i++) {
|
|
21383
21383
|
desc = descriptors[i];
|
|
21384
21384
|
lastChar = desc[desc.length - 1];
|
|
@@ -21386,7 +21386,7 @@ var require_parse_srcset = __commonJS((exports, module) => {
|
|
|
21386
21386
|
intVal = parseInt(value, 10);
|
|
21387
21387
|
floatVal = parseFloat(value);
|
|
21388
21388
|
if (regexNonNegativeInteger.test(value) && lastChar === "w") {
|
|
21389
|
-
if (w2 ||
|
|
21389
|
+
if (w2 || d) {
|
|
21390
21390
|
pError = true;
|
|
21391
21391
|
}
|
|
21392
21392
|
if (intVal === 0) {
|
|
@@ -21395,22 +21395,22 @@ var require_parse_srcset = __commonJS((exports, module) => {
|
|
|
21395
21395
|
w2 = intVal;
|
|
21396
21396
|
}
|
|
21397
21397
|
} else if (regexFloatingPoint.test(value) && lastChar === "x") {
|
|
21398
|
-
if (w2 ||
|
|
21398
|
+
if (w2 || d || h2) {
|
|
21399
21399
|
pError = true;
|
|
21400
21400
|
}
|
|
21401
21401
|
if (floatVal < 0) {
|
|
21402
21402
|
pError = true;
|
|
21403
21403
|
} else {
|
|
21404
|
-
|
|
21404
|
+
d = floatVal;
|
|
21405
21405
|
}
|
|
21406
21406
|
} else if (regexNonNegativeInteger.test(value) && lastChar === "h") {
|
|
21407
|
-
if (
|
|
21407
|
+
if (h2 || d) {
|
|
21408
21408
|
pError = true;
|
|
21409
21409
|
}
|
|
21410
21410
|
if (intVal === 0) {
|
|
21411
21411
|
pError = true;
|
|
21412
21412
|
} else {
|
|
21413
|
-
|
|
21413
|
+
h2 = intVal;
|
|
21414
21414
|
}
|
|
21415
21415
|
} else {
|
|
21416
21416
|
pError = true;
|
|
@@ -21421,11 +21421,11 @@ var require_parse_srcset = __commonJS((exports, module) => {
|
|
|
21421
21421
|
if (w2) {
|
|
21422
21422
|
candidate.w = w2;
|
|
21423
21423
|
}
|
|
21424
|
-
if (
|
|
21425
|
-
candidate.d =
|
|
21424
|
+
if (d) {
|
|
21425
|
+
candidate.d = d;
|
|
21426
21426
|
}
|
|
21427
|
-
if (
|
|
21428
|
-
candidate.h =
|
|
21427
|
+
if (h2) {
|
|
21428
|
+
candidate.h = h2;
|
|
21429
21429
|
}
|
|
21430
21430
|
candidates.push(candidate);
|
|
21431
21431
|
} else if (console && console.log) {
|
|
@@ -31365,7 +31365,7 @@ function G(u) {
|
|
|
31365
31365
|
T = u;
|
|
31366
31366
|
}
|
|
31367
31367
|
var I = { exec: () => null };
|
|
31368
|
-
function
|
|
31368
|
+
function h(u, e = "") {
|
|
31369
31369
|
let t = typeof u == "string" ? u : u.source, n = { replace: (r, i) => {
|
|
31370
31370
|
let s = typeof i == "string" ? i : i.source;
|
|
31371
31371
|
return s = s.replace(m.caret, "$1"), t = t.replace(r, s), n;
|
|
@@ -31380,22 +31380,22 @@ var E = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
|
|
|
31380
31380
|
var Oe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
|
|
31381
31381
|
var F = /(?:[*+-]|\d{1,9}[.)])/;
|
|
31382
31382
|
var ie = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
|
|
31383
|
-
var oe =
|
|
31384
|
-
var we =
|
|
31383
|
+
var oe = h(ie).replace(/bull/g, F).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();
|
|
31384
|
+
var we = h(ie).replace(/bull/g, F).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();
|
|
31385
31385
|
var j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
|
|
31386
31386
|
var ye = /^[^\n]+/;
|
|
31387
31387
|
var Q = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
|
|
31388
|
-
var Pe =
|
|
31389
|
-
var Se =
|
|
31388
|
+
var Pe = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
|
|
31389
|
+
var Se = h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, F).getRegex();
|
|
31390
31390
|
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";
|
|
31391
31391
|
var U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
|
|
31392
|
-
var $e =
|
|
31393
|
-
var ae =
|
|
31394
|
-
var _e =
|
|
31392
|
+
var $e = h("^ {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", U).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
|
|
31393
|
+
var ae = h(j).replace("hr", E).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();
|
|
31394
|
+
var _e = h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex();
|
|
31395
31395
|
var K = { blockquote: _e, code: Re, def: Pe, fences: Te, heading: Oe, hr: E, html: $e, lheading: oe, list: Se, newline: be, paragraph: ae, table: I, text: ye };
|
|
31396
|
-
var re =
|
|
31397
|
-
var Le = { ...K, lheading: we, table: re, paragraph:
|
|
31398
|
-
var Me = { ...K, html:
|
|
31396
|
+
var re = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", E).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();
|
|
31397
|
+
var Le = { ...K, lheading: we, table: re, paragraph: h(j).replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).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() };
|
|
31398
|
+
var Me = { ...K, html: h(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", U).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: I, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: h(j).replace("hr", E).replace("heading", ` *#{1,6} *[^
|
|
31399
31399
|
]`).replace("lheading", oe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
|
|
31400
31400
|
var ze = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
|
|
31401
31401
|
var Ae = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
|
|
@@ -31404,32 +31404,32 @@ var Ie = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}
|
|
|
31404
31404
|
var D = /[\p{P}\p{S}]/u;
|
|
31405
31405
|
var W = /[\s\p{P}\p{S}]/u;
|
|
31406
31406
|
var ue = /[^\s\p{P}\p{S}]/u;
|
|
31407
|
-
var Ee =
|
|
31407
|
+
var Ee = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, W).getRegex();
|
|
31408
31408
|
var pe = /(?!~)[\p{P}\p{S}]/u;
|
|
31409
31409
|
var Ce = /(?!~)[\s\p{P}\p{S}]/u;
|
|
31410
31410
|
var Be = /(?:[^\s\p{P}\p{S}]|~)/u;
|
|
31411
|
-
var qe = /\[(?:[^\[\]`]
|
|
31411
|
+
var qe = h(/link|code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<!`)(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("code", /(?<!`)(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
|
|
31412
31412
|
var ce = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
|
|
31413
|
-
var ve =
|
|
31414
|
-
var De =
|
|
31413
|
+
var ve = h(ce, "u").replace(/punct/g, D).getRegex();
|
|
31414
|
+
var De = h(ce, "u").replace(/punct/g, pe).getRegex();
|
|
31415
31415
|
var he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
|
|
31416
|
-
var He =
|
|
31417
|
-
var Ze =
|
|
31418
|
-
var Ge =
|
|
31419
|
-
var Ne =
|
|
31420
|
-
var Fe =
|
|
31421
|
-
var je =
|
|
31422
|
-
var Qe =
|
|
31416
|
+
var He = h(he, "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex();
|
|
31417
|
+
var Ze = h(he, "gu").replace(/notPunctSpace/g, Be).replace(/punctSpace/g, Ce).replace(/punct/g, pe).getRegex();
|
|
31418
|
+
var Ge = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex();
|
|
31419
|
+
var Ne = h(/\\(punct)/, "gu").replace(/punct/g, D).getRegex();
|
|
31420
|
+
var Fe = h(/^<(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();
|
|
31421
|
+
var je = h(U).replace("(?:-->|$)", "-->").getRegex();
|
|
31422
|
+
var Qe = h("^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", je).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
|
|
31423
31423
|
var q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/;
|
|
31424
|
-
var Ue =
|
|
31425
|
-
var de =
|
|
31426
|
-
var ke =
|
|
31427
|
-
var Ke =
|
|
31424
|
+
var Ue = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
|
|
31425
|
+
var de = h(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", Q).getRegex();
|
|
31426
|
+
var ke = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex();
|
|
31427
|
+
var Ke = h("reflink|nolink(?!\\()", "g").replace("reflink", de).replace("nolink", ke).getRegex();
|
|
31428
31428
|
var se = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
|
|
31429
31429
|
var X = { _backpedal: I, anyPunctuation: Ne, autolink: Fe, blockSkip: qe, br: le, code: Ae, del: I, emStrongLDelim: ve, emStrongRDelimAst: He, emStrongRDelimUnd: Ge, escape: ze, link: Ue, nolink: ke, punctuation: Ee, reflink: de, reflinkSearch: Ke, tag: Qe, text: Ie, url: I };
|
|
31430
|
-
var We = { ...X, link:
|
|
31431
|
-
var N = { ...X, emStrongRDelimAst: Ze, emStrongLDelim: De, url:
|
|
31432
|
-
var Xe = { ...N, br:
|
|
31430
|
+
var We = { ...X, link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() };
|
|
31431
|
+
var N = { ...X, emStrongRDelimAst: Ze, emStrongLDelim: De, url: h(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", se).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: h(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", se).getRegex() };
|
|
31432
|
+
var Xe = { ...N, br: h(le).replace("{2,}", "*").getRegex(), text: h(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
|
|
31433
31433
|
var C = { normal: K, gfm: Le, pedantic: Me };
|
|
31434
31434
|
var M = { normal: X, gfm: N, breaks: Xe, pedantic: We };
|
|
31435
31435
|
var Je = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
|
|
@@ -31586,20 +31586,20 @@ ${p}` : p;
|
|
|
31586
31586
|
let g = this.lexer.state.top;
|
|
31587
31587
|
if (this.lexer.state.top = true, this.lexer.blockTokens(p, s, true), this.lexer.state.top = g, n.length === 0)
|
|
31588
31588
|
break;
|
|
31589
|
-
let
|
|
31590
|
-
if (
|
|
31589
|
+
let d = s.at(-1);
|
|
31590
|
+
if (d?.type === "code")
|
|
31591
31591
|
break;
|
|
31592
|
-
if (
|
|
31593
|
-
let R =
|
|
31592
|
+
if (d?.type === "blockquote") {
|
|
31593
|
+
let R = d, f = R.raw + `
|
|
31594
31594
|
` + n.join(`
|
|
31595
31595
|
`), O = this.blockquote(f);
|
|
31596
31596
|
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;
|
|
31597
31597
|
break;
|
|
31598
|
-
} else if (
|
|
31599
|
-
let R =
|
|
31598
|
+
} else if (d?.type === "list") {
|
|
31599
|
+
let R = d, f = R.raw + `
|
|
31600
31600
|
` + n.join(`
|
|
31601
31601
|
`), O = this.list(f);
|
|
31602
|
-
s[s.length - 1] = O, r = r.substring(0, r.length -
|
|
31602
|
+
s[s.length - 1] = O, r = r.substring(0, r.length - d.raw.length) + O.raw, i = i.substring(0, i.length - R.raw.length) + O.raw, n = f.substring(s.at(-1).raw.length).split(`
|
|
31603
31603
|
`);
|
|
31604
31604
|
continue;
|
|
31605
31605
|
}
|
|
@@ -31619,26 +31619,26 @@ ${p}` : p;
|
|
|
31619
31619
|
break;
|
|
31620
31620
|
c = t[0], e = e.substring(c.length);
|
|
31621
31621
|
let g = t[2].split(`
|
|
31622
|
-
`, 1)[0].replace(this.rules.other.listReplaceTabs, (H) => " ".repeat(3 * H.length)),
|
|
31622
|
+
`, 1)[0].replace(this.rules.other.listReplaceTabs, (H) => " ".repeat(3 * H.length)), d = e.split(`
|
|
31623
31623
|
`, 1)[0], R = !g.trim(), f = 0;
|
|
31624
|
-
if (this.options.pedantic ? (f = 2, p = g.trimStart()) : R ? f = t[1].length + 1 : (f = t[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, p = g.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(
|
|
31625
|
-
`, e = e.substring(
|
|
31624
|
+
if (this.options.pedantic ? (f = 2, p = g.trimStart()) : R ? f = t[1].length + 1 : (f = t[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, p = g.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(d) && (c += d + `
|
|
31625
|
+
`, e = e.substring(d.length + 1), l = true), !l) {
|
|
31626
31626
|
let H = this.rules.other.nextBulletRegex(f), ee = this.rules.other.hrRegex(f), te = this.rules.other.fencesBeginRegex(f), ne = this.rules.other.headingBeginRegex(f), xe = this.rules.other.htmlBeginRegex(f);
|
|
31627
31627
|
for (;e; ) {
|
|
31628
31628
|
let Z = e.split(`
|
|
31629
31629
|
`, 1)[0], A;
|
|
31630
|
-
if (
|
|
31630
|
+
if (d = Z, this.options.pedantic ? (d = d.replace(this.rules.other.listReplaceNesting, " "), A = d) : A = d.replace(this.rules.other.tabCharGlobal, " "), te.test(d) || ne.test(d) || xe.test(d) || H.test(d) || ee.test(d))
|
|
31631
31631
|
break;
|
|
31632
|
-
if (A.search(this.rules.other.nonSpaceChar) >= f || !
|
|
31632
|
+
if (A.search(this.rules.other.nonSpaceChar) >= f || !d.trim())
|
|
31633
31633
|
p += `
|
|
31634
31634
|
` + A.slice(f);
|
|
31635
31635
|
else {
|
|
31636
31636
|
if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || te.test(g) || ne.test(g) || ee.test(g))
|
|
31637
31637
|
break;
|
|
31638
31638
|
p += `
|
|
31639
|
-
` +
|
|
31639
|
+
` + d;
|
|
31640
31640
|
}
|
|
31641
|
-
!R && !
|
|
31641
|
+
!R && !d.trim() && (R = true), c += Z + `
|
|
31642
31642
|
`, e = e.substring(Z.length + 1), g = A.slice(f);
|
|
31643
31643
|
}
|
|
31644
31644
|
}
|
|
@@ -31777,13 +31777,13 @@ ${p}` : p;
|
|
|
31777
31777
|
if (l -= a, l > 0)
|
|
31778
31778
|
continue;
|
|
31779
31779
|
a = Math.min(a, a + l + c);
|
|
31780
|
-
let g = [...r[0]][0].length,
|
|
31780
|
+
let g = [...r[0]][0].length, d = e.slice(0, s + r.index + g + a);
|
|
31781
31781
|
if (Math.min(s, a) % 2) {
|
|
31782
|
-
let f =
|
|
31783
|
-
return { type: "em", raw:
|
|
31782
|
+
let f = d.slice(1, -1);
|
|
31783
|
+
return { type: "em", raw: d, text: f, tokens: this.lexer.inlineTokens(f) };
|
|
31784
31784
|
}
|
|
31785
|
-
let R =
|
|
31786
|
-
return { type: "strong", raw:
|
|
31785
|
+
let R = d.slice(2, -2);
|
|
31786
|
+
return { type: "strong", raw: d, text: R, tokens: this.lexer.inlineTokens(R) };
|
|
31787
31787
|
}
|
|
31788
31788
|
}
|
|
31789
31789
|
}
|
|
@@ -32534,8 +32534,8 @@ var B = class {
|
|
|
32534
32534
|
return (async () => {
|
|
32535
32535
|
let a = s.hooks ? await s.hooks.preprocess(n) : n, c = await (s.hooks ? await s.hooks.provideLexer() : e ? x.lex : x.lexInline)(a, s), p = s.hooks ? await s.hooks.processAllTokens(c) : c;
|
|
32536
32536
|
s.walkTokens && await Promise.all(this.walkTokens(p, s.walkTokens));
|
|
32537
|
-
let
|
|
32538
|
-
return s.hooks ? await s.hooks.postprocess(
|
|
32537
|
+
let d = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(p, s);
|
|
32538
|
+
return s.hooks ? await s.hooks.postprocess(d) : d;
|
|
32539
32539
|
})().catch(o);
|
|
32540
32540
|
try {
|
|
32541
32541
|
s.hooks && (n = s.hooks.preprocess(n));
|
|
@@ -32690,42 +32690,65 @@ core_default.registerLanguage("diff", diff);
|
|
|
32690
32690
|
core_default.registerLanguage("python", python);
|
|
32691
32691
|
core_default.registerLanguage("json", json);
|
|
32692
32692
|
core_default.registerLanguage("swift", swift);
|
|
32693
|
-
var
|
|
32694
|
-
|
|
32695
|
-
|
|
32696
|
-
|
|
32697
|
-
|
|
32698
|
-
|
|
32699
|
-
|
|
32700
|
-
})
|
|
32701
|
-
|
|
32702
|
-
|
|
32703
|
-
|
|
32704
|
-
|
|
32705
|
-
|
|
32706
|
-
|
|
32707
|
-
|
|
32708
|
-
|
|
32709
|
-
|
|
32710
|
-
|
|
32711
|
-
token.
|
|
32712
|
-
if (
|
|
32713
|
-
token.
|
|
32714
|
-
|
|
32715
|
-
|
|
32716
|
-
|
|
32717
|
-
|
|
32718
|
-
|
|
32719
|
-
preprocess(markdown2) {
|
|
32720
|
-
return markdown2;
|
|
32693
|
+
var noFollowExceptions = new Set;
|
|
32694
|
+
function createMarked() {
|
|
32695
|
+
const marked = new B(markedHighlight({
|
|
32696
|
+
emptyLangClass: "hljs",
|
|
32697
|
+
langPrefix: "hljs language-",
|
|
32698
|
+
highlight(code, lang, info) {
|
|
32699
|
+
const language = core_default.getLanguage(lang) ? lang : "json";
|
|
32700
|
+
return core_default.highlight(code, { language }).value;
|
|
32701
|
+
}
|
|
32702
|
+
}));
|
|
32703
|
+
marked.setOptions({
|
|
32704
|
+
gfm: true,
|
|
32705
|
+
breaks: true
|
|
32706
|
+
});
|
|
32707
|
+
marked.use({
|
|
32708
|
+
walkTokens(token) {
|
|
32709
|
+
if (token.type === "link") {
|
|
32710
|
+
token.href = token.href || "";
|
|
32711
|
+
const isExternal = token.href && (token.href.startsWith("http://") || token.href.startsWith("https://") || token.href.startsWith("//"));
|
|
32712
|
+
if (isExternal) {
|
|
32713
|
+
token.isExternalLink = true;
|
|
32714
|
+
if (token.href.includes("youtube.com/watch") || token.href.includes("youtu.be/")) {
|
|
32715
|
+
token.isYouTubeLink = true;
|
|
32716
|
+
}
|
|
32717
|
+
}
|
|
32718
|
+
}
|
|
32721
32719
|
},
|
|
32722
|
-
|
|
32723
|
-
|
|
32724
|
-
|
|
32725
|
-
|
|
32720
|
+
hooks: {
|
|
32721
|
+
preprocess(markdown2) {
|
|
32722
|
+
return markdown2;
|
|
32723
|
+
},
|
|
32724
|
+
postprocess(html) {
|
|
32725
|
+
html = html.replace(/<a href="(https?:\/\/(www\.)?(youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)[^"]*)"[^>]*>(.*?)<\/a>/g, '<div class="video-container"><iframe src="https://www.youtube.com/embed/$4" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen loading="lazy"></iframe></div>');
|
|
32726
|
+
html = html.replace(/<img /g, '<img loading="lazy" ');
|
|
32727
|
+
return html.replace(/<a href="(https?:\/\/|\/\/)([^"]+)"/g, (match, protocol, rest) => {
|
|
32728
|
+
const fullUrl = protocol + rest;
|
|
32729
|
+
let relAttr = 'rel="noopener noreferrer';
|
|
32730
|
+
try {
|
|
32731
|
+
const url = new URL(fullUrl);
|
|
32732
|
+
const domain = url.hostname.replace(/^www\./, "");
|
|
32733
|
+
if (!noFollowExceptions.has(domain)) {
|
|
32734
|
+
relAttr += " nofollow";
|
|
32735
|
+
}
|
|
32736
|
+
} catch {
|
|
32737
|
+
relAttr += " nofollow";
|
|
32738
|
+
}
|
|
32739
|
+
relAttr += '"';
|
|
32740
|
+
return `<a href="${fullUrl}" target="_blank" ${relAttr}`;
|
|
32741
|
+
});
|
|
32742
|
+
}
|
|
32726
32743
|
}
|
|
32727
|
-
}
|
|
32728
|
-
|
|
32744
|
+
});
|
|
32745
|
+
return marked;
|
|
32746
|
+
}
|
|
32747
|
+
var marked = createMarked();
|
|
32748
|
+
function setNoFollowExceptions(exceptions) {
|
|
32749
|
+
noFollowExceptions = new Set(exceptions.map((domain) => domain.toLowerCase().replace(/^www\./, "")));
|
|
32750
|
+
marked = createMarked();
|
|
32751
|
+
}
|
|
32729
32752
|
function extractExcerpt(content, maxLength = 200) {
|
|
32730
32753
|
const plainText = content.replace(/^#.*$/gm, "").replace(/```[\s\S]*?```/g, "").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/[*_]{1,2}([^*_]+)[*_]{1,2}/g, "$1").replace(/\n+/g, " ").trim();
|
|
32731
32754
|
if (plainText.length <= maxLength) {
|
|
@@ -33022,7 +33045,7 @@ class SiteGenerator {
|
|
|
33022
33045
|
const pstDate = new Date(date).toLocaleString("en-US", {
|
|
33023
33046
|
timeZone: "America/Los_Angeles"
|
|
33024
33047
|
});
|
|
33025
|
-
const
|
|
33048
|
+
const d = new Date(pstDate);
|
|
33026
33049
|
const months = [
|
|
33027
33050
|
"January",
|
|
33028
33051
|
"February",
|
|
@@ -33038,15 +33061,15 @@ class SiteGenerator {
|
|
|
33038
33061
|
"December"
|
|
33039
33062
|
];
|
|
33040
33063
|
if (format === "YYYY") {
|
|
33041
|
-
return
|
|
33064
|
+
return d.getFullYear();
|
|
33042
33065
|
} else if (format === "MMMM D, YYYY") {
|
|
33043
|
-
return `${months[
|
|
33066
|
+
return `${months[d.getMonth()]} ${d.getDate()}, ${d.getFullYear()}`;
|
|
33044
33067
|
} else if (format === "MMMM D, YYYY h:mm A") {
|
|
33045
|
-
const hours =
|
|
33046
|
-
const ampm =
|
|
33047
|
-
return `${months[
|
|
33068
|
+
const hours = d.getHours() % 12 || 12;
|
|
33069
|
+
const ampm = d.getHours() >= 12 ? "PM" : "AM";
|
|
33070
|
+
return `${months[d.getMonth()]} ${d.getDate()}, ${d.getFullYear()} @ ${hours} ${ampm}`;
|
|
33048
33071
|
} else {
|
|
33049
|
-
return
|
|
33072
|
+
return d.toLocaleDateString("en-US", {
|
|
33050
33073
|
timeZone: "America/Los_Angeles"
|
|
33051
33074
|
});
|
|
33052
33075
|
}
|
|
@@ -33055,6 +33078,9 @@ class SiteGenerator {
|
|
|
33055
33078
|
async initialize() {
|
|
33056
33079
|
console.log("Initializing site generator...");
|
|
33057
33080
|
await ensureDir(this.options.outputDir);
|
|
33081
|
+
if (this.options.config.noFollowExceptions) {
|
|
33082
|
+
setNoFollowExceptions(this.options.config.noFollowExceptions);
|
|
33083
|
+
}
|
|
33058
33084
|
let tagDescriptions = {};
|
|
33059
33085
|
const tagsTomlPath = path5.join(process.cwd(), "src", "tags.toml");
|
|
33060
33086
|
const tagsTomlFile = Bun.file(tagsTomlPath);
|
|
@@ -33574,16 +33600,16 @@ class S3Uploader {
|
|
|
33574
33600
|
try {
|
|
33575
33601
|
console.log(`[S3] Checking if directory exists: ${imagesDir}`);
|
|
33576
33602
|
try {
|
|
33577
|
-
const glob2 = new Bun.Glob("
|
|
33578
|
-
let
|
|
33603
|
+
const glob2 = new Bun.Glob("**/*");
|
|
33604
|
+
let hasContent = false;
|
|
33579
33605
|
for await (const file of glob2.scan({
|
|
33580
33606
|
cwd: imagesDir,
|
|
33581
33607
|
absolute: false
|
|
33582
33608
|
})) {
|
|
33583
|
-
|
|
33609
|
+
hasContent = true;
|
|
33584
33610
|
break;
|
|
33585
33611
|
}
|
|
33586
|
-
if (!
|
|
33612
|
+
if (!hasContent) {
|
|
33587
33613
|
console.warn(`Directory exists but is empty: ${imagesDir}`);
|
|
33588
33614
|
}
|
|
33589
33615
|
console.log(`[S3] Directory exists and is accessible`);
|
|
@@ -33596,7 +33622,7 @@ class S3Uploader {
|
|
|
33596
33622
|
const files = [];
|
|
33597
33623
|
console.log(`[S3] Scanning directory ${imagesDir} for image files...`);
|
|
33598
33624
|
try {
|
|
33599
|
-
const dirGlob = new Bun.Glob("
|
|
33625
|
+
const dirGlob = new Bun.Glob("**/*");
|
|
33600
33626
|
const allFiles = [];
|
|
33601
33627
|
for await (const file of dirGlob.scan({
|
|
33602
33628
|
cwd: imagesDir,
|
|
@@ -33604,7 +33630,7 @@ class S3Uploader {
|
|
|
33604
33630
|
})) {
|
|
33605
33631
|
allFiles.push(file);
|
|
33606
33632
|
}
|
|
33607
|
-
console.log(`[S3] Files in directory: ${allFiles.join(", ")
|
|
33633
|
+
console.log(`[S3] Files in directory (including subdirs): ${allFiles.length > 0 ? allFiles.slice(0, 10).join(", ") + (allFiles.length > 10 ? "..." : "") : "none"}`);
|
|
33608
33634
|
} catch (err) {
|
|
33609
33635
|
console.error(`[S3] Error reading directory:`, err);
|
|
33610
33636
|
}
|
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(d, b2) {
|
|
6551
|
+
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b3) {
|
|
6552
|
+
d2.__proto__ = b3;
|
|
6553
|
+
} || function(d2, b3) {
|
|
6554
6554
|
for (var p in b3)
|
|
6555
6555
|
if (Object.prototype.hasOwnProperty.call(b3, p))
|
|
6556
|
-
|
|
6556
|
+
d2[p] = b3[p];
|
|
6557
6557
|
};
|
|
6558
|
-
return extendStatics(
|
|
6558
|
+
return extendStatics(d, b2);
|
|
6559
6559
|
};
|
|
6560
|
-
return function(
|
|
6560
|
+
return function(d, 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(d, b2);
|
|
6564
6564
|
function __() {
|
|
6565
|
-
this.constructor =
|
|
6565
|
+
this.constructor = d;
|
|
6566
6566
|
}
|
|
6567
|
-
|
|
6567
|
+
d.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, d, h2, 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 || d) {
|
|
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 || d || h2) {
|
|
8690
8690
|
pError = true;
|
|
8691
8691
|
}
|
|
8692
8692
|
if (floatVal < 0) {
|
|
8693
8693
|
pError = true;
|
|
8694
8694
|
} else {
|
|
8695
|
-
|
|
8695
|
+
d = floatVal;
|
|
8696
8696
|
}
|
|
8697
8697
|
} else if (regexNonNegativeInteger.test(value) && lastChar === "h") {
|
|
8698
|
-
if (
|
|
8698
|
+
if (h2 || d) {
|
|
8699
8699
|
pError = true;
|
|
8700
8700
|
}
|
|
8701
8701
|
if (intVal === 0) {
|
|
8702
8702
|
pError = true;
|
|
8703
8703
|
} else {
|
|
8704
|
-
|
|
8704
|
+
h2 = 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 (d) {
|
|
8716
|
+
candidate.d = d;
|
|
8717
8717
|
}
|
|
8718
|
-
if (
|
|
8719
|
-
candidate.h =
|
|
8718
|
+
if (h2) {
|
|
8719
|
+
candidate.h = h2;
|
|
8720
8720
|
}
|
|
8721
8721
|
candidates.push(candidate);
|
|
8722
8722
|
} else if (console && console.log) {
|
|
@@ -29010,7 +29010,7 @@ function G(u) {
|
|
|
29010
29010
|
T = u;
|
|
29011
29011
|
}
|
|
29012
29012
|
var I = { exec: () => null };
|
|
29013
|
-
function
|
|
29013
|
+
function h(u, e = "") {
|
|
29014
29014
|
let t = typeof u == "string" ? u : u.source, n = { replace: (r, i) => {
|
|
29015
29015
|
let s = typeof i == "string" ? i : i.source;
|
|
29016
29016
|
return s = s.replace(m.caret, "$1"), t = t.replace(r, s), n;
|
|
@@ -29025,22 +29025,22 @@ var E = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
|
|
|
29025
29025
|
var Oe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
|
|
29026
29026
|
var F = /(?:[*+-]|\d{1,9}[.)])/;
|
|
29027
29027
|
var ie = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
|
|
29028
|
-
var oe =
|
|
29029
|
-
var we =
|
|
29028
|
+
var oe = h(ie).replace(/bull/g, F).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();
|
|
29029
|
+
var we = h(ie).replace(/bull/g, F).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();
|
|
29030
29030
|
var j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
|
|
29031
29031
|
var ye = /^[^\n]+/;
|
|
29032
29032
|
var Q = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
|
|
29033
|
-
var Pe =
|
|
29034
|
-
var Se =
|
|
29033
|
+
var Pe = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
|
|
29034
|
+
var Se = h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, F).getRegex();
|
|
29035
29035
|
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";
|
|
29036
29036
|
var U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
|
|
29037
|
-
var $e =
|
|
29038
|
-
var ae =
|
|
29039
|
-
var _e =
|
|
29037
|
+
var $e = h("^ {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", U).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
|
|
29038
|
+
var ae = h(j).replace("hr", E).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();
|
|
29039
|
+
var _e = h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex();
|
|
29040
29040
|
var K = { blockquote: _e, code: Re, def: Pe, fences: Te, heading: Oe, hr: E, html: $e, lheading: oe, list: Se, newline: be, paragraph: ae, table: I, text: ye };
|
|
29041
|
-
var re =
|
|
29042
|
-
var Le = { ...K, lheading: we, table: re, paragraph:
|
|
29043
|
-
var Me = { ...K, html:
|
|
29041
|
+
var re = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", E).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();
|
|
29042
|
+
var Le = { ...K, lheading: we, table: re, paragraph: h(j).replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).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() };
|
|
29043
|
+
var Me = { ...K, html: h(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", U).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: I, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: h(j).replace("hr", E).replace("heading", ` *#{1,6} *[^
|
|
29044
29044
|
]`).replace("lheading", oe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
|
|
29045
29045
|
var ze = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
|
|
29046
29046
|
var Ae = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
|
|
@@ -29049,32 +29049,32 @@ var Ie = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}
|
|
|
29049
29049
|
var D = /[\p{P}\p{S}]/u;
|
|
29050
29050
|
var W = /[\s\p{P}\p{S}]/u;
|
|
29051
29051
|
var ue = /[^\s\p{P}\p{S}]/u;
|
|
29052
|
-
var Ee =
|
|
29052
|
+
var Ee = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, W).getRegex();
|
|
29053
29053
|
var pe = /(?!~)[\p{P}\p{S}]/u;
|
|
29054
29054
|
var Ce = /(?!~)[\s\p{P}\p{S}]/u;
|
|
29055
29055
|
var Be = /(?:[^\s\p{P}\p{S}]|~)/u;
|
|
29056
|
-
var qe = /\[(?:[^\[\]`]
|
|
29056
|
+
var qe = h(/link|code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<!`)(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("code", /(?<!`)(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
|
|
29057
29057
|
var ce = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
|
|
29058
|
-
var ve =
|
|
29059
|
-
var De =
|
|
29058
|
+
var ve = h(ce, "u").replace(/punct/g, D).getRegex();
|
|
29059
|
+
var De = h(ce, "u").replace(/punct/g, pe).getRegex();
|
|
29060
29060
|
var he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
|
|
29061
|
-
var He =
|
|
29062
|
-
var Ze =
|
|
29063
|
-
var Ge =
|
|
29064
|
-
var Ne =
|
|
29065
|
-
var Fe =
|
|
29066
|
-
var je =
|
|
29067
|
-
var Qe =
|
|
29061
|
+
var He = h(he, "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex();
|
|
29062
|
+
var Ze = h(he, "gu").replace(/notPunctSpace/g, Be).replace(/punctSpace/g, Ce).replace(/punct/g, pe).getRegex();
|
|
29063
|
+
var Ge = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex();
|
|
29064
|
+
var Ne = h(/\\(punct)/, "gu").replace(/punct/g, D).getRegex();
|
|
29065
|
+
var Fe = h(/^<(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();
|
|
29066
|
+
var je = h(U).replace("(?:-->|$)", "-->").getRegex();
|
|
29067
|
+
var Qe = h("^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", je).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
|
|
29068
29068
|
var q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/;
|
|
29069
|
-
var Ue =
|
|
29070
|
-
var de =
|
|
29071
|
-
var ke =
|
|
29072
|
-
var Ke =
|
|
29069
|
+
var Ue = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
|
|
29070
|
+
var de = h(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", Q).getRegex();
|
|
29071
|
+
var ke = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex();
|
|
29072
|
+
var Ke = h("reflink|nolink(?!\\()", "g").replace("reflink", de).replace("nolink", ke).getRegex();
|
|
29073
29073
|
var se = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
|
|
29074
29074
|
var X = { _backpedal: I, anyPunctuation: Ne, autolink: Fe, blockSkip: qe, br: le, code: Ae, del: I, emStrongLDelim: ve, emStrongRDelimAst: He, emStrongRDelimUnd: Ge, escape: ze, link: Ue, nolink: ke, punctuation: Ee, reflink: de, reflinkSearch: Ke, tag: Qe, text: Ie, url: I };
|
|
29075
|
-
var We = { ...X, link:
|
|
29076
|
-
var N = { ...X, emStrongRDelimAst: Ze, emStrongLDelim: De, url:
|
|
29077
|
-
var Xe = { ...N, br:
|
|
29075
|
+
var We = { ...X, link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() };
|
|
29076
|
+
var N = { ...X, emStrongRDelimAst: Ze, emStrongLDelim: De, url: h(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", se).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: h(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", se).getRegex() };
|
|
29077
|
+
var Xe = { ...N, br: h(le).replace("{2,}", "*").getRegex(), text: h(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
|
|
29078
29078
|
var C = { normal: K, gfm: Le, pedantic: Me };
|
|
29079
29079
|
var M = { normal: X, gfm: N, breaks: Xe, pedantic: We };
|
|
29080
29080
|
var Je = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
|
|
@@ -29231,20 +29231,20 @@ ${p}` : p;
|
|
|
29231
29231
|
let g = this.lexer.state.top;
|
|
29232
29232
|
if (this.lexer.state.top = true, this.lexer.blockTokens(p, s, true), this.lexer.state.top = g, n.length === 0)
|
|
29233
29233
|
break;
|
|
29234
|
-
let
|
|
29235
|
-
if (
|
|
29234
|
+
let d = s.at(-1);
|
|
29235
|
+
if (d?.type === "code")
|
|
29236
29236
|
break;
|
|
29237
|
-
if (
|
|
29238
|
-
let R =
|
|
29237
|
+
if (d?.type === "blockquote") {
|
|
29238
|
+
let R = d, f = R.raw + `
|
|
29239
29239
|
` + n.join(`
|
|
29240
29240
|
`), O = this.blockquote(f);
|
|
29241
29241
|
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;
|
|
29242
29242
|
break;
|
|
29243
|
-
} else if (
|
|
29244
|
-
let R =
|
|
29243
|
+
} else if (d?.type === "list") {
|
|
29244
|
+
let R = d, f = R.raw + `
|
|
29245
29245
|
` + n.join(`
|
|
29246
29246
|
`), O = this.list(f);
|
|
29247
|
-
s[s.length - 1] = O, r = r.substring(0, r.length -
|
|
29247
|
+
s[s.length - 1] = O, r = r.substring(0, r.length - d.raw.length) + O.raw, i = i.substring(0, i.length - R.raw.length) + O.raw, n = f.substring(s.at(-1).raw.length).split(`
|
|
29248
29248
|
`);
|
|
29249
29249
|
continue;
|
|
29250
29250
|
}
|
|
@@ -29264,26 +29264,26 @@ ${p}` : p;
|
|
|
29264
29264
|
break;
|
|
29265
29265
|
c = t[0], e = e.substring(c.length);
|
|
29266
29266
|
let g = t[2].split(`
|
|
29267
|
-
`, 1)[0].replace(this.rules.other.listReplaceTabs, (H) => " ".repeat(3 * H.length)),
|
|
29267
|
+
`, 1)[0].replace(this.rules.other.listReplaceTabs, (H) => " ".repeat(3 * H.length)), d = e.split(`
|
|
29268
29268
|
`, 1)[0], R = !g.trim(), f = 0;
|
|
29269
|
-
if (this.options.pedantic ? (f = 2, p = g.trimStart()) : R ? f = t[1].length + 1 : (f = t[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, p = g.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(
|
|
29270
|
-
`, e = e.substring(
|
|
29269
|
+
if (this.options.pedantic ? (f = 2, p = g.trimStart()) : R ? f = t[1].length + 1 : (f = t[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, p = g.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(d) && (c += d + `
|
|
29270
|
+
`, e = e.substring(d.length + 1), l = true), !l) {
|
|
29271
29271
|
let H = this.rules.other.nextBulletRegex(f), ee = this.rules.other.hrRegex(f), te = this.rules.other.fencesBeginRegex(f), ne = this.rules.other.headingBeginRegex(f), xe = this.rules.other.htmlBeginRegex(f);
|
|
29272
29272
|
for (;e; ) {
|
|
29273
29273
|
let Z = e.split(`
|
|
29274
29274
|
`, 1)[0], A;
|
|
29275
|
-
if (
|
|
29275
|
+
if (d = Z, this.options.pedantic ? (d = d.replace(this.rules.other.listReplaceNesting, " "), A = d) : A = d.replace(this.rules.other.tabCharGlobal, " "), te.test(d) || ne.test(d) || xe.test(d) || H.test(d) || ee.test(d))
|
|
29276
29276
|
break;
|
|
29277
|
-
if (A.search(this.rules.other.nonSpaceChar) >= f || !
|
|
29277
|
+
if (A.search(this.rules.other.nonSpaceChar) >= f || !d.trim())
|
|
29278
29278
|
p += `
|
|
29279
29279
|
` + A.slice(f);
|
|
29280
29280
|
else {
|
|
29281
29281
|
if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || te.test(g) || ne.test(g) || ee.test(g))
|
|
29282
29282
|
break;
|
|
29283
29283
|
p += `
|
|
29284
|
-
` +
|
|
29284
|
+
` + d;
|
|
29285
29285
|
}
|
|
29286
|
-
!R && !
|
|
29286
|
+
!R && !d.trim() && (R = true), c += Z + `
|
|
29287
29287
|
`, e = e.substring(Z.length + 1), g = A.slice(f);
|
|
29288
29288
|
}
|
|
29289
29289
|
}
|
|
@@ -29422,13 +29422,13 @@ ${p}` : p;
|
|
|
29422
29422
|
if (l -= a, l > 0)
|
|
29423
29423
|
continue;
|
|
29424
29424
|
a = Math.min(a, a + l + c);
|
|
29425
|
-
let g = [...r[0]][0].length,
|
|
29425
|
+
let g = [...r[0]][0].length, d = e.slice(0, s + r.index + g + a);
|
|
29426
29426
|
if (Math.min(s, a) % 2) {
|
|
29427
|
-
let f =
|
|
29428
|
-
return { type: "em", raw:
|
|
29427
|
+
let f = d.slice(1, -1);
|
|
29428
|
+
return { type: "em", raw: d, text: f, tokens: this.lexer.inlineTokens(f) };
|
|
29429
29429
|
}
|
|
29430
|
-
let R =
|
|
29431
|
-
return { type: "strong", raw:
|
|
29430
|
+
let R = d.slice(2, -2);
|
|
29431
|
+
return { type: "strong", raw: d, text: R, tokens: this.lexer.inlineTokens(R) };
|
|
29432
29432
|
}
|
|
29433
29433
|
}
|
|
29434
29434
|
}
|
|
@@ -30179,8 +30179,8 @@ var B = class {
|
|
|
30179
30179
|
return (async () => {
|
|
30180
30180
|
let a = s.hooks ? await s.hooks.preprocess(n) : n, c = await (s.hooks ? await s.hooks.provideLexer() : e ? x.lex : x.lexInline)(a, s), p = s.hooks ? await s.hooks.processAllTokens(c) : c;
|
|
30181
30181
|
s.walkTokens && await Promise.all(this.walkTokens(p, s.walkTokens));
|
|
30182
|
-
let
|
|
30183
|
-
return s.hooks ? await s.hooks.postprocess(
|
|
30182
|
+
let d = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(p, s);
|
|
30183
|
+
return s.hooks ? await s.hooks.postprocess(d) : d;
|
|
30184
30184
|
})().catch(o);
|
|
30185
30185
|
try {
|
|
30186
30186
|
s.hooks && (n = s.hooks.preprocess(n));
|
|
@@ -30335,42 +30335,65 @@ core_default.registerLanguage("diff", diff);
|
|
|
30335
30335
|
core_default.registerLanguage("python", python);
|
|
30336
30336
|
core_default.registerLanguage("json", json);
|
|
30337
30337
|
core_default.registerLanguage("swift", swift);
|
|
30338
|
-
var
|
|
30339
|
-
|
|
30340
|
-
|
|
30341
|
-
|
|
30342
|
-
|
|
30343
|
-
|
|
30344
|
-
|
|
30345
|
-
})
|
|
30346
|
-
|
|
30347
|
-
|
|
30348
|
-
|
|
30349
|
-
|
|
30350
|
-
|
|
30351
|
-
|
|
30352
|
-
|
|
30353
|
-
|
|
30354
|
-
|
|
30355
|
-
|
|
30356
|
-
token.
|
|
30357
|
-
if (
|
|
30358
|
-
token.
|
|
30359
|
-
|
|
30360
|
-
|
|
30361
|
-
|
|
30362
|
-
|
|
30363
|
-
|
|
30364
|
-
preprocess(markdown2) {
|
|
30365
|
-
return markdown2;
|
|
30338
|
+
var noFollowExceptions = new Set;
|
|
30339
|
+
function createMarked() {
|
|
30340
|
+
const marked = new B(markedHighlight({
|
|
30341
|
+
emptyLangClass: "hljs",
|
|
30342
|
+
langPrefix: "hljs language-",
|
|
30343
|
+
highlight(code, lang, info) {
|
|
30344
|
+
const language = core_default.getLanguage(lang) ? lang : "json";
|
|
30345
|
+
return core_default.highlight(code, { language }).value;
|
|
30346
|
+
}
|
|
30347
|
+
}));
|
|
30348
|
+
marked.setOptions({
|
|
30349
|
+
gfm: true,
|
|
30350
|
+
breaks: true
|
|
30351
|
+
});
|
|
30352
|
+
marked.use({
|
|
30353
|
+
walkTokens(token) {
|
|
30354
|
+
if (token.type === "link") {
|
|
30355
|
+
token.href = token.href || "";
|
|
30356
|
+
const isExternal = token.href && (token.href.startsWith("http://") || token.href.startsWith("https://") || token.href.startsWith("//"));
|
|
30357
|
+
if (isExternal) {
|
|
30358
|
+
token.isExternalLink = true;
|
|
30359
|
+
if (token.href.includes("youtube.com/watch") || token.href.includes("youtu.be/")) {
|
|
30360
|
+
token.isYouTubeLink = true;
|
|
30361
|
+
}
|
|
30362
|
+
}
|
|
30363
|
+
}
|
|
30366
30364
|
},
|
|
30367
|
-
|
|
30368
|
-
|
|
30369
|
-
|
|
30370
|
-
|
|
30365
|
+
hooks: {
|
|
30366
|
+
preprocess(markdown2) {
|
|
30367
|
+
return markdown2;
|
|
30368
|
+
},
|
|
30369
|
+
postprocess(html) {
|
|
30370
|
+
html = html.replace(/<a href="(https?:\/\/(www\.)?(youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)[^"]*)"[^>]*>(.*?)<\/a>/g, '<div class="video-container"><iframe src="https://www.youtube.com/embed/$4" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen loading="lazy"></iframe></div>');
|
|
30371
|
+
html = html.replace(/<img /g, '<img loading="lazy" ');
|
|
30372
|
+
return html.replace(/<a href="(https?:\/\/|\/\/)([^"]+)"/g, (match, protocol, rest) => {
|
|
30373
|
+
const fullUrl = protocol + rest;
|
|
30374
|
+
let relAttr = 'rel="noopener noreferrer';
|
|
30375
|
+
try {
|
|
30376
|
+
const url = new URL(fullUrl);
|
|
30377
|
+
const domain = url.hostname.replace(/^www\./, "");
|
|
30378
|
+
if (!noFollowExceptions.has(domain)) {
|
|
30379
|
+
relAttr += " nofollow";
|
|
30380
|
+
}
|
|
30381
|
+
} catch {
|
|
30382
|
+
relAttr += " nofollow";
|
|
30383
|
+
}
|
|
30384
|
+
relAttr += '"';
|
|
30385
|
+
return `<a href="${fullUrl}" target="_blank" ${relAttr}`;
|
|
30386
|
+
});
|
|
30387
|
+
}
|
|
30371
30388
|
}
|
|
30372
|
-
}
|
|
30373
|
-
|
|
30389
|
+
});
|
|
30390
|
+
return marked;
|
|
30391
|
+
}
|
|
30392
|
+
var marked = createMarked();
|
|
30393
|
+
function setNoFollowExceptions(exceptions) {
|
|
30394
|
+
noFollowExceptions = new Set(exceptions.map((domain) => domain.toLowerCase().replace(/^www\./, "")));
|
|
30395
|
+
marked = createMarked();
|
|
30396
|
+
}
|
|
30374
30397
|
function extractExcerpt(content, maxLength = 200) {
|
|
30375
30398
|
const plainText = content.replace(/^#.*$/gm, "").replace(/```[\s\S]*?```/g, "").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/[*_]{1,2}([^*_]+)[*_]{1,2}/g, "$1").replace(/\n+/g, " ").trim();
|
|
30376
30399
|
if (plainText.length <= maxLength) {
|
|
@@ -30894,7 +30917,7 @@ class SiteGenerator {
|
|
|
30894
30917
|
const pstDate = new Date(date).toLocaleString("en-US", {
|
|
30895
30918
|
timeZone: "America/Los_Angeles"
|
|
30896
30919
|
});
|
|
30897
|
-
const
|
|
30920
|
+
const d = new Date(pstDate);
|
|
30898
30921
|
const months = [
|
|
30899
30922
|
"January",
|
|
30900
30923
|
"February",
|
|
@@ -30910,15 +30933,15 @@ class SiteGenerator {
|
|
|
30910
30933
|
"December"
|
|
30911
30934
|
];
|
|
30912
30935
|
if (format === "YYYY") {
|
|
30913
|
-
return
|
|
30936
|
+
return d.getFullYear();
|
|
30914
30937
|
} else if (format === "MMMM D, YYYY") {
|
|
30915
|
-
return `${months[
|
|
30938
|
+
return `${months[d.getMonth()]} ${d.getDate()}, ${d.getFullYear()}`;
|
|
30916
30939
|
} else if (format === "MMMM D, YYYY h:mm A") {
|
|
30917
|
-
const hours =
|
|
30918
|
-
const ampm =
|
|
30919
|
-
return `${months[
|
|
30940
|
+
const hours = d.getHours() % 12 || 12;
|
|
30941
|
+
const ampm = d.getHours() >= 12 ? "PM" : "AM";
|
|
30942
|
+
return `${months[d.getMonth()]} ${d.getDate()}, ${d.getFullYear()} @ ${hours} ${ampm}`;
|
|
30920
30943
|
} else {
|
|
30921
|
-
return
|
|
30944
|
+
return d.toLocaleDateString("en-US", {
|
|
30922
30945
|
timeZone: "America/Los_Angeles"
|
|
30923
30946
|
});
|
|
30924
30947
|
}
|
|
@@ -30927,6 +30950,9 @@ class SiteGenerator {
|
|
|
30927
30950
|
async initialize() {
|
|
30928
30951
|
console.log("Initializing site generator...");
|
|
30929
30952
|
await ensureDir(this.options.outputDir);
|
|
30953
|
+
if (this.options.config.noFollowExceptions) {
|
|
30954
|
+
setNoFollowExceptions(this.options.config.noFollowExceptions);
|
|
30955
|
+
}
|
|
30930
30956
|
let tagDescriptions = {};
|
|
30931
30957
|
const tagsTomlPath = path5.join(process.cwd(), "src", "tags.toml");
|
|
30932
30958
|
const tagsTomlFile = Bun.file(tagsTomlPath);
|
|
@@ -31445,16 +31471,16 @@ class S3Uploader {
|
|
|
31445
31471
|
try {
|
|
31446
31472
|
console.log(`[S3] Checking if directory exists: ${imagesDir}`);
|
|
31447
31473
|
try {
|
|
31448
|
-
const glob2 = new Bun.Glob("
|
|
31449
|
-
let
|
|
31474
|
+
const glob2 = new Bun.Glob("**/*");
|
|
31475
|
+
let hasContent = false;
|
|
31450
31476
|
for await (const file of glob2.scan({
|
|
31451
31477
|
cwd: imagesDir,
|
|
31452
31478
|
absolute: false
|
|
31453
31479
|
})) {
|
|
31454
|
-
|
|
31480
|
+
hasContent = true;
|
|
31455
31481
|
break;
|
|
31456
31482
|
}
|
|
31457
|
-
if (!
|
|
31483
|
+
if (!hasContent) {
|
|
31458
31484
|
console.warn(`Directory exists but is empty: ${imagesDir}`);
|
|
31459
31485
|
}
|
|
31460
31486
|
console.log(`[S3] Directory exists and is accessible`);
|
|
@@ -31467,7 +31493,7 @@ class S3Uploader {
|
|
|
31467
31493
|
const files = [];
|
|
31468
31494
|
console.log(`[S3] Scanning directory ${imagesDir} for image files...`);
|
|
31469
31495
|
try {
|
|
31470
|
-
const dirGlob = new Bun.Glob("
|
|
31496
|
+
const dirGlob = new Bun.Glob("**/*");
|
|
31471
31497
|
const allFiles = [];
|
|
31472
31498
|
for await (const file of dirGlob.scan({
|
|
31473
31499
|
cwd: imagesDir,
|
|
@@ -31475,7 +31501,7 @@ class S3Uploader {
|
|
|
31475
31501
|
})) {
|
|
31476
31502
|
allFiles.push(file);
|
|
31477
31503
|
}
|
|
31478
|
-
console.log(`[S3] Files in directory: ${allFiles.join(", ")
|
|
31504
|
+
console.log(`[S3] Files in directory (including subdirs): ${allFiles.length > 0 ? allFiles.slice(0, 10).join(", ") + (allFiles.length > 10 ? "..." : "") : "none"}`);
|
|
31479
31505
|
} catch (err) {
|
|
31480
31506
|
console.error(`[S3] Error reading directory:`, err);
|
|
31481
31507
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -56,6 +56,8 @@ export interface SiteConfig {
|
|
|
56
56
|
css?: CSSConfig;
|
|
57
57
|
/** Optional number of tags to display on homepage (sorted by count). If not set, all tags are shown */
|
|
58
58
|
maxTagsOnHomepage?: number;
|
|
59
|
+
/** Optional list of domains to exclude from nofollow attribute. Links to these domains will have follow attribute. */
|
|
60
|
+
noFollowExceptions?: string[];
|
|
59
61
|
/** Additional custom configuration options */
|
|
60
62
|
[key: string]: any;
|
|
61
63
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Post } from "../types";
|
|
2
|
+
export declare function setNoFollowExceptions(exceptions: string[]): void;
|
|
2
3
|
export declare function extractExcerpt(content: string, maxLength?: number): string;
|
|
3
4
|
export declare function convertMarkdownToHtml(markdownContent: string): string;
|
|
4
5
|
export declare function parseMarkdownFile(filePath: string): Promise<Post | null>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bunki",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "An opinionated static site generator built with Bun featuring PostCSS integration and modern web development workflows",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"commander": "^14.0.1",
|
|
51
51
|
"gray-matter": "^4.0.3",
|
|
52
52
|
"highlight.js": "^11.11.1",
|
|
53
|
-
"marked": "^16.4.
|
|
53
|
+
"marked": "^16.4.1",
|
|
54
54
|
"marked-highlight": "^2.2.2",
|
|
55
55
|
"nunjucks": "^3.2.4",
|
|
56
56
|
"postcss": "^8.5.6",
|