This commit is contained in:
2026-02-06 23:58:52 +08:00
parent d1e8818920
commit 1aca11db75
2 changed files with 5 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@hatterjiang/term-color-render",
"version": "1.0.2",
"version": "1.0.3",
"description": "Render color for term use syntax like [red]text[/red]",
"license": "MIT",
"author": "Hatter Jiang",

View File

@@ -115,7 +115,10 @@ function renderColorTokens(tokens: ColorToken[], renderColor: boolean): string {
const colors: string[] = [];
for (const [color, colorStack] of colorMapStack) {
if (colorStack.length > 0) {
colors.push(colorCode);
const currentColorCode = COLOR_MAP[color];
if (currentColorCode) {
colors.push(currentColorCode);
}
}
}
if (colors.length > 0) {