diff --git a/modules/@angular/compiler/src/shadow_css.ts b/modules/@angular/compiler/src/shadow_css.ts index 6d29a69711..03ab00b165 100644 --- a/modules/@angular/compiler/src/shadow_css.ts +++ b/modules/@angular/compiler/src/shadow_css.ts @@ -426,7 +426,7 @@ export class ShadowCss { return scopedP; }; - const sep = /( |>|\+|~)\s*/g; + const sep = /( |>|\+|~(?!=))\s*/g; const scopeAfter = selector.indexOf(_polyfillHostNoCombinator); let scoped = ''; diff --git a/modules/@angular/compiler/test/shadow_css_spec.ts b/modules/@angular/compiler/test/shadow_css_spec.ts index 51f3e45d17..4298e7a18b 100644 --- a/modules/@angular/compiler/test/shadow_css_spec.ts +++ b/modules/@angular/compiler/test/shadow_css_spec.ts @@ -91,6 +91,7 @@ export function main() { expect(s('one[attr$="value"] {}', 'a')).toEqual('one[attr$="value"][a] {}'); expect(s('one[attr*="value"] {}', 'a')).toEqual('one[attr*="value"][a] {}'); expect(s('one[attr|="value"] {}', 'a')).toEqual('one[attr|="value"][a] {}'); + expect(s('one[attr~="value"] {}', 'a')).toEqual('one[attr~="value"][a] {}'); expect(s('one[attr] {}', 'a')).toEqual('one[attr][a] {}'); expect(s('[is="one"] {}', 'a')).toEqual('[is="one"][a] {}'); });