Skip to content

Commit

Permalink
fix eclipse-theia#7680 fix css escape
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-François Monnier <kessler.dev@gmail.com>
  • Loading branch information
kesslerdev committed Jul 2, 2020
1 parent 64244a5 commit 0854e65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## v1.4.0

- [core] fixed handling of environment variables on Windows [#7973](https://github.com/eclipse-theia/theia/pull/7973)
- [plugin-ext] fix file-icon incorrectly displays name icon with a dot in name [#7680](https://github.com/eclipse-theia/theia/pull/7680)

## v1.3.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,16 +337,11 @@ export class PluginIconTheme extends PluginIconThemeDefinition implements IconTh
}

protected escapeCSS(value: string): string {
try {
return CSS.escape(value);
} catch {
// Edge and Safari on iOS does not support `CSS.escape` yet, remove it when they do
value = value.replace(/[^\-a-zA-Z0-9]/g, '-');
if (value.charAt(0).match(/[0-9\-]/)) {
value = '-' + value;
}
return value;
value = value.replace(/[^\-a-zA-Z0-9]/g, '-');
if (value.charAt(0).match(/[0-9\-]/)) {
value = '-' + value;
}
return value;
}

protected readonly fileIcon = 'theia-plugin-file-icon';
Expand Down

0 comments on commit 0854e65

Please sign in to comment.