Skip to content

Commit

Permalink
8536-compatibility-third-party-themes
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Arad <dan.arad@sap.com>
  • Loading branch information
danarad05 authored and amiramw committed Feb 3, 2021
1 parent 925c0db commit ce58aad
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ce58aad

Please sign in to comment.