mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
regexp: Unnecessary escapes of -
This commit is contained in:
parent
4df57580d3
commit
8215e18557
|
@ -678,8 +678,8 @@ function toCSSSelector(extensionId: string, path: string) {
|
|||
let str = `${extensionId}-${path}`;
|
||||
|
||||
//remove all characters that are not allowed in css
|
||||
str = str.replace(/[^_\-a-zA-Z0-9]/g, '-');
|
||||
if (str.charAt(0).match(/[0-9\-]/)) {
|
||||
str = str.replace(/[^_a-zA-Z0-9-]/g, '-');
|
||||
if (str.charAt(0).match(/[0-9-]/)) {
|
||||
str = '_' + str;
|
||||
}
|
||||
return str;
|
||||
|
|
|
@ -40,7 +40,7 @@ suite('Color Registry', function () {
|
|||
const reqContext = await new RequestService(new TestConfigurationService(), environmentService, new NullLogService()).request({ url: 'https://raw.githubusercontent.com/microsoft/vscode-docs/vnext/api/references/theme-color.md' }, CancellationToken.None);
|
||||
const content = (await asText(reqContext))!;
|
||||
|
||||
const expression = /\-\s*\`([\w\.]+)\`: (.*)/g;
|
||||
const expression = /-\s*\`([\w\.]+)\`: (.*)/g;
|
||||
|
||||
let m: RegExpExecArray | null;
|
||||
let colorsInDoc: { [id: string]: ColorInfo } = Object.create(null);
|
||||
|
|
Loading…
Reference in a new issue