forked from sveltejs/prettier-plugin-svelte
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When snipping the tag contents, after replacing a match, we need to adjust the matching spans as the content length now differs. Else "is within other span" might give wrong results. Fixes sveltejs#255
- Loading branch information
Simon Holthausen
committed
Oct 20, 2021
1 parent
21a9a54
commit 1d8c64c
Showing
3 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script lang="ts" context="module"> | ||
// we need a certain length here | ||
</script> | ||
|
||
<script lang="ts"> | ||
// we need a certain length here | ||
</script> | ||
|
||
<style type="scss"> | ||
/* we need a certain length here */ | ||
</style> | ||
|
||
<!-- this test checks that the matching spans are adjusted after replacing the code, as otherwise it would mess up the snipping --> |
3 changes: 3 additions & 0 deletions
3
test/printer/samples/style-scripts-snipping-spans.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"svelteSortOrder": "options-scripts-styles-markup" | ||
} |