Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
aaa's `bbb 'ccc'`
`ddd`
---

[#1 Content] =
[#1 Removal] =
[#1 Domain] = 0:3-0:12
>---------<
0| aaa's `bbb 'ccc'`

[#1 Interior: Content] = 0:4-0:10
>------<
0| aaa's `bbb 'ccc'`
[#1 Interior: Removal] = 0:4-0:11
>-------<
0| aaa's `bbb 'ccc'`

[#1 Boundary L] = 0:3-0:4
>-<
0| aaa's `bbb 'ccc'`

[#1 Boundary R] = 0:11-0:12
>-<
0| aaa's `bbb 'ccc'`

[#1 Insertion delimiter] = " "


[#2 Content] =
[#2 Domain] = 0:6-0:17
>-----------<
0| aaa's `bbb 'ccc'`

[#2 Removal] = 0:5-0:17
>------------<
0| aaa's `bbb 'ccc'`

[#2 Leading delimiter] = 0:5-0:6
>-<
0| aaa's `bbb 'ccc'`

[#2 Interior] = 0:7-0:16
>---------<
0| aaa's `bbb 'ccc'`

[#2 Boundary L] = 0:6-0:7
>-<
0| aaa's `bbb 'ccc'`

[#2 Boundary R] = 0:16-0:17
>-<
0| aaa's `bbb 'ccc'`

[#2 Insertion delimiter] = " "


[#3 Content] =
[#3 Removal] =
[#3 Domain] = 1:0-1:5
>-----<
1| `ddd`

[#3 Interior] = 1:1-1:4
>---<
1| `ddd`

[#3 Boundary L] = 1:0-1:1
>-<
1| `ddd`

[#3 Boundary R] = 1:4-1:5
>-<
1| `ddd`

[#3 Insertion delimiter] = " "
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,16 @@ export function getSurroundingPairOccurrences(

const openingDelimiter = openingDelimitersStack[openingDelimiterIndex];

// Pop stack up to and including the opening delimiter
openingDelimitersStack.length = openingDelimiterIndex;
if (side === "unknown") {
// For ambiguous delimiters (eg quotes), remove only the matched
// entry so that unrelated delimiter types pushed between the
// matched pair are preserved. See #3109.
openingDelimitersStack.splice(openingDelimiterIndex, 1);
} else {
// For non-ambiguous delimiters (eg parentheses), truncate the
// stack to enforce proper nesting.
openingDelimitersStack.length = openingDelimiterIndex;
}

result.push({
delimiterName: delimiterName,
Expand Down
Loading