@pep/term-deck 1.2.0 → 1.2.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/bin/term-deck.js +17 -1
- package/dist/bin/term-deck.js.map +1 -1
- package/package.json +1 -1
package/dist/bin/term-deck.js
CHANGED
|
@@ -696,8 +696,22 @@ var init_mermaid = __esm({
|
|
|
696
696
|
});
|
|
697
697
|
|
|
698
698
|
// src/core/content-processor.ts
|
|
699
|
+
function processCodeBlocks(content) {
|
|
700
|
+
return content.replace(CODE_BLOCK_PATTERN, (_match, _lang, code) => {
|
|
701
|
+
const lines = code.trimEnd().split("\n");
|
|
702
|
+
const maxLen = Math.max(...lines.map((l) => l.length), 20);
|
|
703
|
+
const top = "\u250C" + "\u2500".repeat(maxLen + 2) + "\u2510";
|
|
704
|
+
const bottom = "\u2514" + "\u2500".repeat(maxLen + 2) + "\u2518";
|
|
705
|
+
const boxedLines = lines.map((line) => {
|
|
706
|
+
const padded = line.padEnd(maxLen);
|
|
707
|
+
return `\u2502 ${padded} \u2502`;
|
|
708
|
+
});
|
|
709
|
+
return [top, ...boxedLines, bottom].join("\n");
|
|
710
|
+
});
|
|
711
|
+
}
|
|
699
712
|
async function processSlideContent(body, theme) {
|
|
700
713
|
let processed = processMermaidDiagrams(body);
|
|
714
|
+
processed = processCodeBlocks(processed);
|
|
701
715
|
processed = colorTokensToBlessedTags(processed, theme);
|
|
702
716
|
return processed;
|
|
703
717
|
}
|
|
@@ -705,11 +719,13 @@ function normalizeBigText(bigText) {
|
|
|
705
719
|
if (!bigText) return [];
|
|
706
720
|
return Array.isArray(bigText) ? bigText : [bigText];
|
|
707
721
|
}
|
|
722
|
+
var CODE_BLOCK_PATTERN;
|
|
708
723
|
var init_content_processor = __esm({
|
|
709
724
|
"src/core/content-processor.ts"() {
|
|
710
725
|
init_esm_shims();
|
|
711
726
|
init_theme2();
|
|
712
727
|
init_mermaid();
|
|
728
|
+
CODE_BLOCK_PATTERN = /```(\w*)\n([\s\S]*?)```/g;
|
|
713
729
|
}
|
|
714
730
|
});
|
|
715
731
|
|
|
@@ -3668,7 +3684,7 @@ var init_main = __esm({
|
|
|
3668
3684
|
init_esm_shims();
|
|
3669
3685
|
|
|
3670
3686
|
// package.json
|
|
3671
|
-
var version = "1.2.
|
|
3687
|
+
var version = "1.2.1";
|
|
3672
3688
|
|
|
3673
3689
|
// src/cli/commands/present.ts
|
|
3674
3690
|
init_esm_shims();
|