v 1.0.3
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hatterjiang/term-color-render",
|
"name": "@hatterjiang/term-color-render",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"description": "Render color for term use syntax like [red]text[/red]",
|
"description": "Render color for term use syntax like [red]text[/red]",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "Hatter Jiang",
|
"author": "Hatter Jiang",
|
||||||
|
|||||||
@@ -115,7 +115,10 @@ function renderColorTokens(tokens: ColorToken[], renderColor: boolean): string {
|
|||||||
const colors: string[] = [];
|
const colors: string[] = [];
|
||||||
for (const [color, colorStack] of colorMapStack) {
|
for (const [color, colorStack] of colorMapStack) {
|
||||||
if (colorStack.length > 0) {
|
if (colorStack.length > 0) {
|
||||||
colors.push(colorCode);
|
const currentColorCode = COLOR_MAP[color];
|
||||||
|
if (currentColorCode) {
|
||||||
|
colors.push(currentColorCode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (colors.length > 0) {
|
if (colors.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user