File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,18 @@ export = (mod: { typescript: typeof ts }) => {
36
36
end : number
37
37
) : string {
38
38
const placeholder = templateString . slice ( start , end ) ;
39
+
40
+ // check to see if it's an in-property interplation, or a mixin,
41
+ // and determine which character to use in either case
42
+ // if in-property, replace with "xxxxxx"
43
+ // if a mixin, replace with " "
39
44
const pre = templateString . slice ( 0 , start ) ;
40
45
const replacementChar = pre . match ( / ( ^ | \n ) \s * $ / g) ? ' ' : 'x' ;
41
46
42
47
let result = placeholder . replace ( / ./ gm, c => c === '\n' ? '\n' : replacementChar ) ;
48
+
49
+ // check if it's a mixin and if followed by a semicolon
50
+ // if so, replace with a dummy variable declaration, so scss server doesn't complain about rogue semicolon
43
51
if ( replacementChar === ' ' && templateString . charAt ( end ) === ';' ) {
44
52
result = '$a:0' + result . slice ( 4 ) ;
45
53
}
You can’t perform that action at this time.
0 commit comments