Skip to content

Commit 17c0957

Browse files
committed
Fix missing space after removing multiline comment
- emits unnecessery spaces in some cases
1 parent 054ff85 commit 17c0957

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/__tests__/baselines/minification/minify-css-to-use-without-transpilation.ts.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ TypeScript after transform:
6565
const SpecialCharacters = styled.div.withConfig({ displayName: "SpecialCharacters" }) \`content:" \${props => props.text} ";color:red;\`;
6666
const Comment = styled.div.withConfig({ displayName: "Comment" }) \`width:100%;color:red;\`;
6767
const Parens = styled.div.withConfig({ displayName: "Parens" }) \`&:hover{color:blue;}color:red;\`;
68-
const UrlComments = styled.div.withConfig({ displayName: "UrlComments" }) \`color:red;background:red;border:1px solid green;\`;
68+
const UrlComments = styled.div.withConfig({ displayName: "UrlComments" }) \`color:red; background:red;border:1px solid green;\`;
6969
export {};
7070

7171

src/__tests__/baselines/minification/simple.ts.baseline

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ TypeScript after transform:
148148
styled.div \`https:\`;
149149
// removes multi-line comments
150150
// \`this is a test\`
151-
styled.div \`this is atest\`;
151+
styled.div \`this is a test\`;
152152
// joins all lines of code
153153
// \`this is a test\`
154-
styled.div \`this is atest\`;
154+
styled.div \`this is a test\`;
155155
// removes line comments filling an entire line
156156
// \`line one line two\`
157157
styled.div \`line oneline two\`;
@@ -160,17 +160,17 @@ TypeScript after transform:
160160
styled.div \`valid line without comments\`;
161161
// preserves multi-line comments starting with /*!
162162
// \`this is a /*! dont ignore me please */ test\`
163-
styled.div \`this is atest\`;
163+
styled.div \`this is a test\`;
164164
// returns the indices of removed placeholders (expressions)
165165
// \`this is some input with \${placeholder1} and //\${placeholder2}\`
166166
styled.div \`this is some input with\${placeholder1} and//\${placeholder2}\`;
167167
// works with raw escape codes
168168
// \`this\\\\nis\\\\na \\\\ntest\`
169-
styled.div \`this\\\\nis\\\\na\\\\ntest\`;
169+
styled.div \`this\\\\nis\\\\na \\\\ntest\`;
170170
// \`this\\nis\\na \\ntest\`
171-
styled.div \`this is atest\`;
171+
styled.div \`this is a test\`;
172172
// \`this is a test\`
173-
styled.div \`this is atest\`;
173+
styled.div \`this is a test\`;
174174
// removes spaces around symbols
175175
// \`;:{},;\`
176176
styled.div \`;:{},;\`;

src/minify.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const stateMachine: StateMachine = {
104104
},
105105
'/**': {
106106
next(ch) {
107-
if (ch == '/') return { state: ';', skipEmit: true }
107+
if (ch == '/') return { state: ' ', skipEmit: true }
108108
return { state: '/*', skipEmit: true }
109109
}
110110
},

0 commit comments

Comments
 (0)