From ce58aad52ff7b19011240c96f8978958813e877d Mon Sep 17 00:00:00 2001 From: Dan Arad Date: Mon, 18 Jan 2021 17:40:51 +0200 Subject: [PATCH] 8536-compatibility-third-party-themes Signed-off-by: Dan Arad --- packages/monaco/src/browser/textmate/monaco-theme-registry.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/monaco/src/browser/textmate/monaco-theme-registry.ts b/packages/monaco/src/browser/textmate/monaco-theme-registry.ts index 6907ecdaa1bb4..4fa832ffbee84 100644 --- a/packages/monaco/src/browser/textmate/monaco-theme-registry.ts +++ b/packages/monaco/src/browser/textmate/monaco-theme-registry.ts @@ -140,14 +140,13 @@ export class MonacoThemeRegistry { return undefined; } const normalized = String(color).replace(/^\#/, '').slice(0, 6); - if (normalized.length < 6) { + if (normalized.length < 6 || !(normalized).match(/^[0-9A-Fa-f]{6}$/)) { // ignoring not normalized colors to avoid breaking token color indexes between monaco and vscode-textmate console.error(`Color '${normalized}' is NOT normalized, it must have 6 positions.`); return undefined; } return '#' + normalized; } - } export namespace MonacoThemeRegistry {