nexrall-code 0.5.81 → 0.5.82
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/index.js +10 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -54619,6 +54619,12 @@ function padVis(s2, n) {
|
|
|
54619
54619
|
const pad = n - visibleLen(s2);
|
|
54620
54620
|
return pad > 0 ? s2 + " ".repeat(pad) : s2;
|
|
54621
54621
|
}
|
|
54622
|
+
function ruleWidth(max = 50, columns = process.stdout.columns || 80) {
|
|
54623
|
+
const MIN = 20;
|
|
54624
|
+
const indent = 2;
|
|
54625
|
+
const available = columns - indent;
|
|
54626
|
+
return Math.max(MIN, Math.min(max, available));
|
|
54627
|
+
}
|
|
54622
54628
|
var MarkdownStreamRenderer = class {
|
|
54623
54629
|
_buf = "";
|
|
54624
54630
|
// incomplete trailing chunk
|
|
@@ -54660,7 +54666,7 @@ var MarkdownStreamRenderer = class {
|
|
|
54660
54666
|
this._buf = "";
|
|
54661
54667
|
}
|
|
54662
54668
|
if (this._inCode) {
|
|
54663
|
-
console.log(source_default.dim(" \u2514" + "\u2500".repeat(48)));
|
|
54669
|
+
console.log(source_default.dim(" \u2514" + "\u2500".repeat(ruleWidth(48))));
|
|
54664
54670
|
this._inCode = false;
|
|
54665
54671
|
}
|
|
54666
54672
|
this._flushTable();
|
|
@@ -54713,10 +54719,10 @@ var MarkdownStreamRenderer = class {
|
|
|
54713
54719
|
this._inCode = true;
|
|
54714
54720
|
this._codeLang = raw.slice(3).trim();
|
|
54715
54721
|
const label = this._codeLang ? source_default.dim(` ${this._codeLang}`) : "";
|
|
54716
|
-
console.log("\n" + source_default.dim(" \u250C" + "\u2500".repeat(48)) + label);
|
|
54722
|
+
console.log("\n" + source_default.dim(" \u250C" + "\u2500".repeat(ruleWidth(48))) + label);
|
|
54717
54723
|
} else {
|
|
54718
54724
|
this._inCode = false;
|
|
54719
|
-
console.log(source_default.dim(" \u2514" + "\u2500".repeat(48)) + "\n");
|
|
54725
|
+
console.log(source_default.dim(" \u2514" + "\u2500".repeat(ruleWidth(48))) + "\n");
|
|
54720
54726
|
}
|
|
54721
54727
|
return;
|
|
54722
54728
|
}
|
|
@@ -54735,7 +54741,7 @@ var MarkdownStreamRenderer = class {
|
|
|
54735
54741
|
}
|
|
54736
54742
|
this._flushTable();
|
|
54737
54743
|
if (/^[-*_]{3,}\s*$/.test(raw)) {
|
|
54738
|
-
console.log("\n" + source_default.dim(" " + "\u2500".repeat(50)) + "\n");
|
|
54744
|
+
console.log("\n" + source_default.dim(" " + "\u2500".repeat(ruleWidth(50))) + "\n");
|
|
54739
54745
|
return;
|
|
54740
54746
|
}
|
|
54741
54747
|
if (raw.startsWith("#### ")) {
|