Commit 966204a
committed
Handle adjacent variables case (fix microsoft#62)
By using `contents.slice(listIndex, span.start)` as `pre`, we couldn't
tell the different between ` ${'color: red'};` and the second variable of
`margin: ${'1px'} ${'1px'};`. Both of their `pre` are ` `, hence making
both of them got replaced by `$a:0 `, which cause an error in the
second code (`margin: xxxxxxxx $a:0 ;`).
To tell their different, I decided to use a whole line as a context. Use
the start of the line to the placeholder as `pre`. This way the second
code's `pre` would be `margin: ${'1px'} `, which is now different from
the `pre` of ` ${'color: red'};`.1 parent 79111dd commit 966204a
File tree
3 files changed
+34
-2
lines changed- e2e/tests
- src
- test
3 files changed
+34
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
297 | 308 | | |
298 | 309 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
10 | 15 | | |
11 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
12 | 20 | | |
13 | 21 | | |
14 | 22 | | |
15 | | - | |
| 23 | + | |
16 | 24 | | |
17 | 25 | | |
18 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
135 | 148 | | |
136 | 149 | | |
137 | 150 | | |
| |||
0 commit comments