Skip to content

Commit

Permalink
fix(swc/emotion): Correct the SPACE_AROUND_COLON regex (#39710)
Browse files Browse the repository at this point in the history
## Bug

- [x] fixes #39672 
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
  • Loading branch information
magic-akari committed Aug 18, 2022
1 parent 9c41634 commit 78aefee
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next-swc/crates/emotion/src/lib.rs
Expand Up @@ -82,7 +82,7 @@ static EMOTION_OFFICIAL_LIBRARIES: Lazy<Vec<EmotionModuleConfig>> = Lazy::new(||
});

static SPACE_AROUND_COLON: Lazy<Regex> =
Lazy::new(|| Regex::new(r"\s*(?P<s>[:|;|,|\{,\}])\s*").unwrap());
Lazy::new(|| Regex::new(r"\s*(?P<s>[:;,\{,\}])\s*").unwrap());

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
Expand Down
@@ -0,0 +1,9 @@
import styled from '@emotion/styled'

const SelectedComponent = styled.p`
color: red;
&:after {
content: ' | ';
}
`
@@ -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= */");

0 comments on commit 78aefee

Please sign in to comment.