@f5-sales-demo/pi-tui 23.5.1 → 23.6.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/CHANGELOG.md +3 -0
- package/package.json +3 -3
- package/src/components/markdown.ts +3 -8
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
### Fixed
|
|
8
8
|
|
|
9
|
+
- Render Markdown headings and code examples with theme styling and language labels, without
|
|
10
|
+
displaying hash prefixes or fence delimiters. Literal backticks inside code remain unchanged
|
|
11
|
+
([#4940](https://github.com/f5-sales-demo/xcsh/issues/4940)).
|
|
9
12
|
- Added conservative runtime OSC 8 capability control, safe Markdown link extraction and targets,
|
|
10
13
|
ST normalization, and physical-wrap link isolation. Semantically ported from
|
|
11
14
|
[can1357/oh-my-pi#10196](https://github.com/can1357/oh-my-pi/pull/10196),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@f5-sales-demo/pi-tui",
|
|
4
|
-
"version": "23.
|
|
4
|
+
"version": "23.6.0",
|
|
5
5
|
"description": "Terminal User Interface library with differential rendering for efficient text-based applications",
|
|
6
6
|
"homepage": "https://github.com/f5-sales-demo/xcsh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"fmt": "biome format --write ."
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@f5-sales-demo/pi-natives": "23.
|
|
41
|
-
"@f5-sales-demo/pi-utils": "23.
|
|
40
|
+
"@f5-sales-demo/pi-natives": "23.6.0",
|
|
41
|
+
"@f5-sales-demo/pi-utils": "23.6.0",
|
|
42
42
|
"marked": "18.0.11"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
@@ -621,15 +621,12 @@ export class Markdown implements Component {
|
|
|
621
621
|
switch (token.type) {
|
|
622
622
|
case "heading": {
|
|
623
623
|
const headingLevel = token.depth;
|
|
624
|
-
const headingPrefix = `${"#".repeat(headingLevel)} `;
|
|
625
624
|
const headingText = this.#renderInlineTokens(token.tokens || [], styleContext);
|
|
626
625
|
let styledHeading: string;
|
|
627
626
|
if (headingLevel === 1) {
|
|
628
627
|
styledHeading = this.#theme.heading(this.#theme.bold(this.#theme.underline(headingText)));
|
|
629
|
-
} else if (headingLevel === 2) {
|
|
630
|
-
styledHeading = this.#theme.heading(this.#theme.bold(headingText));
|
|
631
628
|
} else {
|
|
632
|
-
styledHeading = this.#theme.heading(this.#theme.bold(
|
|
629
|
+
styledHeading = this.#theme.heading(this.#theme.bold(headingText));
|
|
633
630
|
}
|
|
634
631
|
lines.push(styledHeading);
|
|
635
632
|
if (nextTokenType && nextTokenType !== "space") {
|
|
@@ -698,7 +695,7 @@ export class Markdown implements Component {
|
|
|
698
695
|
}
|
|
699
696
|
|
|
700
697
|
const codeIndent = padding(this.#codeBlockIndent);
|
|
701
|
-
lines.push(this.#theme.codeBlockBorder(
|
|
698
|
+
if (token.lang) lines.push(this.#theme.codeBlockBorder(token.lang));
|
|
702
699
|
if (this.#theme.highlightCode) {
|
|
703
700
|
const highlightedLines = this.#theme.highlightCode(token.text, token.lang);
|
|
704
701
|
for (const hlLine of highlightedLines) {
|
|
@@ -711,7 +708,6 @@ export class Markdown implements Component {
|
|
|
711
708
|
lines.push(`${codeIndent}${this.#theme.codeBlock(codeLine)}`);
|
|
712
709
|
}
|
|
713
710
|
}
|
|
714
|
-
lines.push(this.#theme.codeBlockBorder("```"));
|
|
715
711
|
if (nextTokenType && nextTokenType !== "space") {
|
|
716
712
|
lines.push(""); // Add spacing after code blocks (unless space token follows)
|
|
717
713
|
}
|
|
@@ -1053,7 +1049,7 @@ export class Markdown implements Component {
|
|
|
1053
1049
|
} else if (token.type === "code") {
|
|
1054
1050
|
// Code block in list item
|
|
1055
1051
|
const codeIndent = padding(this.#codeBlockIndent);
|
|
1056
|
-
lines.push(this.#theme.codeBlockBorder(
|
|
1052
|
+
if (token.lang) lines.push(this.#theme.codeBlockBorder(token.lang));
|
|
1057
1053
|
if (this.#theme.highlightCode) {
|
|
1058
1054
|
const highlightedLines = this.#theme.highlightCode(token.text, token.lang);
|
|
1059
1055
|
for (const hlLine of highlightedLines) {
|
|
@@ -1065,7 +1061,6 @@ export class Markdown implements Component {
|
|
|
1065
1061
|
lines.push(`${codeIndent}${this.#theme.codeBlock(codeLine)}`);
|
|
1066
1062
|
}
|
|
1067
1063
|
}
|
|
1068
|
-
lines.push(this.#theme.codeBlockBorder("```"));
|
|
1069
1064
|
} else {
|
|
1070
1065
|
// Other token types - try to render as inline
|
|
1071
1066
|
const text = this.#renderInlineTokens([token], styleContext);
|