@oh-my-pi/pi-tui 15.1.3 → 15.1.4
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 +6 -0
- package/package.json +3 -3
- package/src/components/markdown.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [15.1.4] - 2026-05-19
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Fixed `renderInlineMarkdown` crashing with `TypeError: undefined is not an object (evaluating 'e.replace')` when called with a non-string value during streaming — partial JSON parsing leaves option label fields temporarily unpopulated, causing the ask tool renderer to fail. ([#1176](https://github.com/can1357/oh-my-pi/issues/1176))
|
|
10
|
+
|
|
5
11
|
## [15.0.2] - 2026-05-15
|
|
6
12
|
|
|
7
13
|
### Added
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-tui",
|
|
4
|
-
"version": "15.1.
|
|
4
|
+
"version": "15.1.4",
|
|
5
5
|
"description": "Terminal User Interface library with differential rendering for efficient text-based applications",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"fmt": "biome format --write ."
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@oh-my-pi/pi-natives": "15.1.
|
|
41
|
-
"@oh-my-pi/pi-utils": "15.1.
|
|
40
|
+
"@oh-my-pi/pi-natives": "15.1.4",
|
|
41
|
+
"@oh-my-pi/pi-utils": "15.1.4",
|
|
42
42
|
"lru-cache": "11.3.6",
|
|
43
43
|
"marked": "^18.0.3"
|
|
44
44
|
},
|
|
@@ -946,6 +946,8 @@ export class Markdown implements Component {
|
|
|
946
946
|
* Unlike the full Markdown component, this produces a single line with no block-level elements.
|
|
947
947
|
*/
|
|
948
948
|
export function renderInlineMarkdown(text: string, mdTheme: MarkdownTheme, baseColor?: (t: string) => string): string {
|
|
949
|
+
// Guard against undefined/null during streaming — partial JSON can leave fields unpopulated.
|
|
950
|
+
if (typeof text !== "string") return (baseColor ?? (t => t))(text != null ? String(text) : "");
|
|
949
951
|
const tokens = marked.lexer(text);
|
|
950
952
|
const applyText = baseColor ?? ((t: string) => t);
|
|
951
953
|
let result = "";
|