-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove generics from script tag before calling svelte preprocessor (#…
- Loading branch information
Showing
3 changed files
with
86 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
'houdini-svelte': patch | ||
--- | ||
|
||
Remove generics from script tag before calling svelte preprocessor. | ||
|
||
Otherwise it will fail to parse the source if the generics attribute contains angle brackets. | ||
|
||
For example this code failed to parse: | ||
|
||
```html | ||
<script lang="ts" generics="T extends Record<string, unknown>"> | ||
</script> | ||
``` | ||
|
||
Now the `parseSvelte` function will remove the generics attribute before calling the svelte preprocessor | ||
preserving the token positions in the source code. | ||
|
||
The output for the above example will be: | ||
|
||
```html | ||
<script lang="ts" > | ||
</script> | ||
``` |
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