Skip to content

Commit 1a5e0ee

Browse files
Fix off-by-one error in Interpolation.spanForElement() (#2568)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
1 parent 735109f commit 1a5e0ee

File tree

7 files changed

+18
-5
lines changed

7 files changed

+18
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.88.1-dev
2+
3+
* Fix a bug when calculating source spans for interpolations.
4+
15
## 1.88.0
26

37
* Deprecate passing a relative URL to `compileString()` and related functions.

lib/src/ast/sass/interpolation.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ final class Interpolation implements SassNode {
6565
FileSpan spanForElement(int index) => switch (contents[index]) {
6666
String() => span.file.span(
6767
(index == 0 ? span.start : spans[index - 1]!.end).offset,
68-
(index == spans.length ? span.end : spans[index + 1]!.start).offset,
68+
(index + 1 == spans.length ? span.end : spans[index + 1]!.start)
69+
.offset,
6970
),
7071
_ => spans[index]!,
7172
};

pkg/sass-parser/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.4.21-dev
2+
3+
* No user-visible changes.
4+
15
## 0.4.20
26

37
* No user-visible changes.

pkg/sass-parser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sass-parser",
3-
"version": "0.4.20",
3+
"version": "0.4.21-dev",
44
"description": "A PostCSS-compatible wrapper of the official Sass parser",
55
"repository": "sass/sass",
66
"author": "Google Inc.",

pkg/sass_api/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 15.5.1-dev
2+
3+
* No user-visible changes.
4+
15
## 15.5.0
26

37
* No user-visible changes.

pkg/sass_api/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ name: sass_api
22
# Note: Every time we add a new Sass AST node, we need to bump the *major*
33
# version because it's a breaking change for anyone who's implementing the
44
# visitor interface(s).
5-
version: 15.5.0
5+
version: 15.5.1-dev
66
description: Additional APIs for Dart Sass.
77
homepage: https://github.com/sass/dart-sass
88

99
environment:
1010
sdk: ">=3.6.0 <4.0.0"
1111

1212
dependencies:
13-
sass: 1.88.0
13+
sass: 1.88.1
1414

1515
dev_dependencies:
1616
dartdoc: ^8.0.14

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sass
2-
version: 1.88.0
2+
version: 1.88.1-dev
33
description: A Sass implementation in Dart.
44
homepage: https://github.com/sass/dart-sass
55

0 commit comments

Comments
 (0)