diff --git a/packages/next-swc/crates/emotion/src/lib.rs b/packages/next-swc/crates/emotion/src/lib.rs index f6ca8eb68ed0024..0059bf69cc331f8 100644 --- a/packages/next-swc/crates/emotion/src/lib.rs +++ b/packages/next-swc/crates/emotion/src/lib.rs @@ -82,7 +82,7 @@ static EMOTION_OFFICIAL_LIBRARIES: Lazy> = Lazy::new(|| }); static SPACE_AROUND_COLON: Lazy = - Lazy::new(|| Regex::new(r"\s*(?P[:|;|,|\{,\}])\s*").unwrap()); + Lazy::new(|| Regex::new(r"\s*(?P[:;,\{,\}])\s*").unwrap()); #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] diff --git a/packages/next-swc/crates/emotion/tests/fixture/issues/39672/input.tsx b/packages/next-swc/crates/emotion/tests/fixture/issues/39672/input.tsx new file mode 100644 index 000000000000000..cabfa5dfb8da60d --- /dev/null +++ b/packages/next-swc/crates/emotion/tests/fixture/issues/39672/input.tsx @@ -0,0 +1,9 @@ +import styled from '@emotion/styled' + +const SelectedComponent = styled.p` + color: red; + + &:after { + content: ' | '; + } +` diff --git a/packages/next-swc/crates/emotion/tests/fixture/issues/39672/output.ts b/packages/next-swc/crates/emotion/tests/fixture/issues/39672/output.ts new file mode 100644 index 000000000000000..f98d584f9465982 --- /dev/null +++ b/packages/next-swc/crates/emotion/tests/fixture/issues/39672/output.ts @@ -0,0 +1,5 @@ +import styled from '@emotion/styled'; +const SelectedComponent = /*#__PURE__*/ styled("p", { + target: "ekie5mj0", + label: "SelectedComponent" +})("color:red;&:after{content:' | ';}", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5wdXQudHMiLCJzb3VyY2VzIjpbImlucHV0LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJ1xuXG5jb25zdCBTZWxlY3RlZENvbXBvbmVudCA9IHN0eWxlZC5wYFxuICBjb2xvcjogcmVkO1xuXG4gICY6YWZ0ZXIge1xuICAgIGNvbnRlbnQ6ICcgfCAnO1xuICB9XG5gXG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRTBCIn0= */");