@@ -11,51 +11,67 @@ Source code:
1111 declare const placeholder2: any;
1212
1313 // splits a line by potential comment starts and joins until one is an actual comment
14+ // \`abc def\`
1415 styled.div\`abc def//ghi//jkl\`
1516
1617 // ignores comment markers that are inside strings
18+ // \`abc def"//"ghi\\'//\\'jkl\`
1719 styled.div\`abc def"//"ghi\\'//\\'jkl//the end\`
20+ // \`abc def"//"\`
1821 styled.div\`abc def"//"\`
1922
2023 // ignores comment markers that are inside parantheses
24+ // \`bla (//) bla\`
2125 styled.div\`bla (//) bla//the end\`
2226
2327 // ignores even unescaped URLs
28+ // \`https://test.com\`
2429 styled.div\`https://test.com// comment//\`
2530
2631 // removes multi-line comments
32+ // \`this is a test\`
2733 styled.div\`this is a/* ignore me please */test\`
2834
2935 // joins all lines of code
36+ // \`this is a test\`
3037 styled.div\`this\\nis\\na/* ignore me \\n please */\\ntest\`
3138
3239 // removes line comments filling an entire line
40+ // \`line one line two\`
3341 styled.div\`line one
3442 // remove this comment
3543 line two\`
3644
3745 // removes line comments at the end of lines of code
46+ // \`valid line with out comments\`
3847 styled.div\`valid line with // a comment
3948 out comments\`
4049
4150 // preserves multi-line comments starting with /*!
51+ // \`this is a /*! dont ignore me please */ test\`
4252 styled.div\`this is a /*! dont ignore me please */ test/* but you can ignore me */\`
4353
4454 // returns the indices of removed placeholders (expressions)
55+ // \`this is some input with \${placeholder1} and //\${placeholder2}\`
4556 styled.div\`this is some\\ninput with \${placeholder1} and // ignored \${placeholder2}\`
4657
4758 // works with raw escape codes
59+ // \`this\\\\nis\\\\na \\\\ntest\`
4860 styled.div\`this\\\\nis\\\\na/* ignore me \\\\n please */\\\\ntest\`
61+ // \`this\\nis\\na \\ntest\`
4962 styled.div\`this\\nis\\na/* ignore me \\n please */\\ntest\`
63+ // \`this is a test\`
5064 styled.div\`this
5165 is
52- a/* ignore me \\n please *
53- ntest \`
66+ a/* ignore me \\n please */
67+ test \`
5468
5569 // removes spaces around symbols
70+ // \`;:{},;\`
5671 styled.div\`; : { } , ; \`
5772
5873 // ignores symbols inside strings
74+ // \`;" : "\\' : \\';\`
5975 styled.div\`; " : " \\' : \\' ;\`
6076
6177
@@ -65,33 +81,49 @@ TypeScript before transform:
6581 declare const placeholder1: any;
6682 declare const placeholder2: any;
6783 // splits a line by potential comment starts and joins until one is an actual comment
84+ // \`abc def\`
6885 styled.div \`abc def//ghi//jkl\`;
6986 // ignores comment markers that are inside strings
87+ // \`abc def"//"ghi\\'//\\'jkl\`
7088 styled.div \`abc def"//"ghi'//'jkl//the end\`;
89+ // \`abc def"//"\`
7190 styled.div \`abc def"//"\`;
7291 // ignores comment markers that are inside parantheses
92+ // \`bla (//) bla\`
7393 styled.div \`bla (//) bla//the end\`;
7494 // ignores even unescaped URLs
95+ // \`https://test.com\`
7596 styled.div \`https://test.com// comment//\`;
7697 // removes multi-line comments
98+ // \`this is a test\`
7799 styled.div \`this is a/* ignore me please */test\`;
78100 // joins all lines of code
101+ // \`this is a test\`
79102 styled.div \`this\\nis\\na/* ignore me \\n please */\\ntest\`;
80103 // removes line comments filling an entire line
104+ // \`line one line two\`
81105 styled.div \`line one\\n// remove this comment\\nline two\`;
82106 // removes line comments at the end of lines of code
107+ // \`valid line with out comments\`
83108 styled.div \`valid line with // a comment\\nout comments\`;
84109 // preserves multi-line comments starting with /*!
110+ // \`this is a /*! dont ignore me please */ test\`
85111 styled.div \`this is a /*! dont ignore me please */ test/* but you can ignore me */\`;
86112 // returns the indices of removed placeholders (expressions)
113+ // \`this is some input with \${placeholder1} and //\${placeholder2}\`
87114 styled.div \`this is some\\ninput with \${placeholder1} and // ignored \${placeholder2}\`;
88115 // works with raw escape codes
116+ // \`this\\\\nis\\\\na \\\\ntest\`
89117 styled.div \`this\\\\nis\\\\na/* ignore me \\\\n please */\\\\ntest\`;
118+ // \`this\\nis\\na \\ntest\`
119+ styled.div \`this\\nis\\na/* ignore me \\n please */\\ntest\`;
120+ // \`this is a test\`
90121 styled.div \`this\\nis\\na/* ignore me \\n please */\\ntest\`;
91- styled.div \`this\\nis\\na/* ignore me \\n please *\\nntest\`;
92122 // removes spaces around symbols
123+ // \`;:{},;\`
93124 styled.div \`; : { } , ; \`;
94125 // ignores symbols inside strings
126+ // \`;" : "\\' : \\';\`
95127 styled.div \`; " : " ' : ' ;\`;
96128
97129
@@ -101,33 +133,49 @@ TypeScript after transform:
101133 declare const placeholder1: any;
102134 declare const placeholder2: any;
103135 // splits a line by potential comment starts and joins until one is an actual comment
104- styled.div \`abc def//\`;
136+ // \`abc def\`
137+ styled.div \`abc def\`;
105138 // ignores comment markers that are inside strings
106- styled.div \`abc def"//"ghi'//'jkl//\`;
139+ // \`abc def"//"ghi\\'//\\'jkl\`
140+ styled.div \`abc def"//"ghi'//'jkl\`;
141+ // \`abc def"//"\`
107142 styled.div \`abc def"//"\`;
108143 // ignores comment markers that are inside parantheses
109- styled.div \`bla (//\`;
144+ // \`bla (//) bla\`
145+ styled.div \`bla (\`;
110146 // ignores even unescaped URLs
111- styled.div \`https://\`;
147+ // \`https://test.com\`
148+ styled.div \`https:\`;
112149 // removes multi-line comments
150+ // \`this is a test\`
113151 styled.div \`this is atest\`;
114152 // joins all lines of code
153+ // \`this is a test\`
115154 styled.div \`this is atest\`;
116155 // removes line comments filling an entire line
156+ // \`line one line two\`
117157 styled.div \`line oneline two\`;
118158 // removes line comments at the end of lines of code
159+ // \`valid line with out comments\`
119160 styled.div \`valid line without comments\`;
120161 // preserves multi-line comments starting with /*!
162+ // \`this is a /*! dont ignore me please */ test\`
121163 styled.div \`this is atest\`;
122164 // returns the indices of removed placeholders (expressions)
165+ // \`this is some input with \${placeholder1} and //\${placeholder2}\`
123166 styled.div \`this is some input with\${placeholder1} and//\${placeholder2}\`;
124167 // works with raw escape codes
168+ // \`this\\\\nis\\\\na \\\\ntest\`
125169 styled.div \`this\\\\nis\\\\na\\\\ntest\`;
170+ // \`this\\nis\\na \\ntest\`
171+ styled.div \`this is atest\`;
172+ // \`this is a test\`
126173 styled.div \`this is atest\`;
127- styled.div \`this is a/*\`;
128174 // removes spaces around symbols
175+ // \`;:{},;\`
129176 styled.div \`;:{},;\`;
130177 // ignores symbols inside strings
178+ // \`;" : "\\' : \\';\`
131179 styled.div \`;" : "' : ';\`;
132180
133181
0 commit comments